> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Wireguard config template for Peer

> Retrieve Wireguard config template for Peer



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/networking/networking.yml get /wireguard_peers/{id}/config
openapi: 3.1.0
info:
  title: Telnyx Networking API
  version: 2.0.0
  description: API for Networking.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /wireguard_peers/{id}/config:
    get:
      tags:
        - WireGuard Interfaces
      summary: Retrieve Wireguard config template for Peer
      description: Retrieve Wireguard config template for Peer
      operationId: GetWireguardPeerConfig
      parameters:
        - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          description: Successful response
          content:
            text/plain:
              schema:
                type: string
                example: |
                  [Interface]
                  PrivateKey = <! INSERT PEER PRIVATE KEY HERE !>
                  Address = 198.51.100.1/32

                  [Peer]
                  PublicKey = qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=
                  AllowedIPs = 198.51.100.0/29
                  Endpoint = 203.0.113.0:51871
                  PersistentKeepalive = 25
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.wireguardPeers.retrieveConfig('6a09cdc3-8948-47f0-aa62-74ac943d6c58');


            console.log(response);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.wireguard_peers.retrieve_config(
                "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
            )
            print(response)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.WireguardPeers.GetConfig(context.TODO(), \"6a09cdc3-8948-47f0-aa62-74ac943d6c58\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.wireguardpeers.WireguardPeerRetrieveConfigParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    String response = client.wireguardPeers().retrieveConfig("6a09cdc3-8948-47f0-aa62-74ac943d6c58");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            response =
            telnyx.wireguard_peers.retrieve_config("6a09cdc3-8948-47f0-aa62-74ac943d6c58")


            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->wireguardPeers->retrieveConfig(
                '6a09cdc3-8948-47f0-aa62-74ac943d6c58'
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx wireguard-peers retrieve-config \
              --api-key 'My API Key' \
              --id 6a09cdc3-8948-47f0-aa62-74ac943d6c58
components:
  parameters:
    ResourceId:
      name: id
      description: Identifies the resource.
      in: path
      required: true
      schema:
        format: uuid
        type: string
        example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
  responses:
    netapps_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
  schemas:
    netapps_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/netapps_Error'
      type: object
    netapps_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````