> ## 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.

# Create a WireGuard Interface

> Create a new WireGuard Interface. Current limitation of 10 interfaces per user can be created.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/networking/networking.yml post /wireguard_interfaces
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_interfaces:
    post:
      tags:
        - WireGuard Interfaces
      summary: Create a WireGuard Interface
      description: >-
        Create a new WireGuard Interface. Current limitation of 10 interfaces
        per user can be created.
      operationId: CreateWireguardInterface
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WireguardInterfaceCreate'
        required: true
      responses:
        '202':
          $ref: '#/components/responses/WireguardInterfaceResponse'
        '422':
          $ref: '#/components/responses/netapps_UnprocessableEntity'
        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 wireguardInterface = await client.wireguardInterfaces.create({
            region_code: 'ashburn-va' });


            console.log(wireguardInterface.data);
        - 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
            )
            wireguard_interface = client.wireguard_interfaces.create(
                region_code="ashburn-va",
            )
            print(wireguard_interface.data)
        - 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\twireguardInterface, err := client.WireguardInterfaces.New(context.TODO(), telnyx.WireguardInterfaceNewParams{\n\t\tRegionCode: \"ashburn-va\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", wireguardInterface.Data)\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.wireguardinterfaces.WireguardInterfaceCreateParams;

            import
            com.telnyx.sdk.models.wireguardinterfaces.WireguardInterfaceCreateResponse;


            public final class Main {
                private Main() {}

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

                    WireguardInterfaceCreateResponse wireguardInterface = client.wireguardInterfaces().create();
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            wireguard_interface =
            telnyx.wireguard_interfaces.create(region_code: "ashburn-va")


            puts(wireguard_interface)
        - 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 {
              $wireguardInterface = $client->wireguardInterfaces->create(
                regionCode: 'ashburn-va',
                enableSipTrunking: false,
                name: 'test interface',
                networkID: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
              );

              var_dump($wireguardInterface);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx wireguard-interfaces create \
              --api-key 'My API Key' \
              --region-code ashburn-va
components:
  schemas:
    WireguardInterfaceCreate:
      allOf:
        - $ref: '#/components/schemas/WireguardInterface'
        - $ref: '#/components/schemas/RegionIn'
        - type: object
          title: WireguardInterfaceCreate
          required:
            - network_id
            - region_code
    WireguardInterface:
      allOf:
        - $ref: '#/components/schemas/Record'
        - $ref: '#/components/schemas/Interface'
        - type: object
          title: WireguardInterface
          properties:
            record_type:
              type: string
              description: Identifies the type of the resource.
              readOnly: true
              example: wireguard_interface
            endpoint:
              type: string
              description: The Telnyx WireGuard peers `Peer.endpoint` value.
              example: 203.0.113.0:51871
              readOnly: true
            public_key:
              type: string
              description: The Telnyx WireGuard peers `Peer.PublicKey`.
              readOnly: true
              example: qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=
            enable_sip_trunking:
              type: boolean
              description: Enable SIP traffic forwarding over VPN interface.
              example: false
    RegionIn:
      type: object
      properties:
        region_code:
          description: The region the interface should be deployed to.
          type: string
          example: ashburn-va
    WireguardInterfaceRead:
      allOf:
        - $ref: '#/components/schemas/WireguardInterface'
        - $ref: '#/components/schemas/RegionOut'
    netapps_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/netapps_Error'
      type: object
    Record:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identifies the resource.
          readOnly: true
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        record_type:
          type: string
          description: Identifies the type of the resource.
          readOnly: true
          example: sample_record_type
        created_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            created.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            updated.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
    Interface:
      type: object
      properties:
        network_id:
          description: The id of the network associated with the interface.
          type: string
          format: uuid
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        name:
          type: string
          description: A user specified name for the interface.
          example: test interface
        status:
          $ref: '#/components/schemas/InterfaceStatus'
    RegionOut:
      type: object
      properties:
        region_code:
          description: The region interface is deployed to.
          type: string
          example: ashburn-va
        region:
          type: object
          properties:
            code:
              description: Region code of the interface.
              type: string
              example: ashburn-va
            name:
              description: Region name of the interface.
              type: string
              example: Ashburn
            record_type:
              type: string
              description: Identifies the type of the resource.
              readOnly: true
              example: region
    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
    InterfaceStatus:
      type: string
      enum:
        - created
        - provisioning
        - provisioned
        - deleting
      description: The current status of the interface deployment.
      readOnly: true
      example: provisioned
  responses:
    WireguardInterfaceResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/WireguardInterfaceRead'
    netapps_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
    netapps_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````