Telnyx Networks API

Network operations

OpenAPI Specification

telnyx-networks-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: Telnyx provides global communications and connectivity APIs for developers — including SIP trunking, programmable voice, SMS, MMS, WhatsApp Business Messaging, Call Control, Fax, Wireless (IoT & eSIM), Phone Numbers (DID provisioning & porting), Emergency Services, and Network APIs for private interconnects and edge connectivity. Build, scale, and manage voice, messaging, and data networks with Telnyx's carrier-grade global infrastructure and API-first platform.
  title: Telnyx Access Tokens Networks API
  version: 2.0.0
  x-endpoint-cost: light
servers:
- description: Version 2.0.0 of the Telnyx API
  url: https://api.telnyx.com/v2
security:
- bearerAuth: []
tags:
- description: Network operations
  name: Networks
paths:
  /networks:
    get:
      description: List all Networks.
      operationId: ListNetworks
      parameters:
      - description: 'Consolidated filter parameter (deepObject style). Originally: filter[name]'
        explode: true
        in: query
        name: filter
        schema:
          properties:
            name:
              description: The network name to filter on.
              example: test network
              type: string
          type: object
        style: deepObject
      - $ref: '#/components/parameters/PageConsolidated'
      responses:
        '200':
          $ref: '#/components/responses/NetworkListResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: List all Networks
      tags:
      - Networks
      x-latency-category: responsive
    post:
      description: Create a new Network.
      operationId: CreateNetwork
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkCreate'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/NetworkResponse'
        '422':
          $ref: '#/components/responses/netapps_UnprocessableEntity'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Create a Network
      tags:
      - Networks
      x-latency-category: responsive
  /networks/{id}:
    delete:
      description: Delete a Network.
      operationId: DeleteNetwork
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          $ref: '#/components/responses/NetworkResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Delete a Network
      tags:
      - Networks
      x-latency-category: responsive
    get:
      description: Retrieve a Network.
      operationId: GetNetwork
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          $ref: '#/components/responses/NetworkResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Retrieve a Network
      tags:
      - Networks
      x-latency-category: responsive
    patch:
      description: Update a Network.
      operationId: UpdateNetwork
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkCreate'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/NetworkResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Update a Network
      tags:
      - Networks
      x-latency-category: responsive
  /networks/{id}/default_gateway:
    delete:
      description: Delete Default Gateway.
      operationId: DeleteDefaultGateway
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          $ref: '#/components/responses/DefaultGatewayResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Delete Default Gateway.
      tags:
      - Networks
      x-latency-category: responsive
    get:
      description: Get Default Gateway status.
      operationId: GetDefaultGateway
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      responses:
        '200':
          $ref: '#/components/responses/DefaultGatewayResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Get Default Gateway status.
      tags:
      - Networks
      x-latency-category: responsive
    post:
      description: Create Default Gateway.
      operationId: CreateDefaultGateway
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DefaultGateway'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/DefaultGatewayResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: Create Default Gateway.
      tags:
      - Networks
      x-latency-category: responsive
  /networks/{id}/network_interfaces:
    get:
      description: List all Interfaces for a Network.
      operationId: ListNetworkInterfaces
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - description: 'Consolidated filter parameter (deepObject style). Originally: filter[name], filter[type], filter[status]'
        explode: true
        in: query
        name: filter
        schema:
          properties:
            name:
              description: The interface name to filter on.
              example: test interface
              type: string
            status:
              $ref: '#/components/schemas/InterfaceStatus'
              description: The interface status to filter on.
            type:
              description: The interface type to filter on.
              example: wireguard_interface
              type: string
          type: object
        style: deepObject
      - $ref: '#/components/parameters/PageConsolidated'
      responses:
        '200':
          $ref: '#/components/responses/NetworkInterfaceListResponse'
        '422':
          $ref: '#/components/responses/netapps_GenericErrorResponse'
        default:
          $ref: '#/components/responses/netapps_GenericErrorResponse'
      summary: List all Interfaces for a Network.
      tags:
      - Networks
      x-latency-category: responsive
components:
  responses:
    NetworkInterfaceListResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/NetworkInterface'
                type: array
              meta:
                $ref: '#/components/schemas/PaginationMeta'
            type: object
      description: Successful response
    NetworkListResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/Network'
                type: array
              meta:
                $ref: '#/components/schemas/PaginationMeta'
            type: object
      description: Successful response
    netapps_GenericErrorResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
      description: Unexpected error
    DefaultGatewayResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/DefaultGateway'
                type: array
              meta:
                $ref: '#/components/schemas/PaginationMeta'
            type: object
      description: Successful response
    netapps_UnprocessableEntity:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
      description: Unprocessable entity. Check the 'detail' field in response for details.
    NetworkResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/Network'
            type: object
      description: Successful response
  schemas:
    netapps_Errors:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/netapps_Error'
          type: array
      type: object
    RegionOut:
      properties:
        region:
          properties:
            code:
              description: Region code of the interface.
              example: ashburn-va
              type: string
            name:
              description: Region name of the interface.
              example: Ashburn
              type: string
            record_type:
              description: Identifies the type of the resource.
              example: region
              readOnly: true
              type: string
          type: object
        region_code:
          description: The region interface is deployed to.
          example: ashburn-va
          type: string
      type: object
    InterfaceStatus:
      description: The current status of the interface deployment.
      enum:
      - created
      - provisioning
      - provisioned
      - deleting
      example: provisioned
      readOnly: true
      type: string
    Network:
      allOf:
      - $ref: '#/components/schemas/Record'
      - properties:
          name:
            description: A user specified name for the network.
            example: test network
            type: string
          record_type:
            description: Identifies the type of the resource.
            example: network
            readOnly: true
            type: string
        title: Network
        type: object
    NetworkInterface:
      allOf:
      - $ref: '#/components/schemas/Record'
      - $ref: '#/components/schemas/Interface'
      - $ref: '#/components/schemas/RegionOut'
      - properties:
          record_type:
            description: Identifies the type of the resource.
            example: network_interface
            readOnly: true
            type: string
          type:
            description: Identifies the type of the interface.
            example: wireguard_interface
            readOnly: true
            type: string
        title: NetworkInterface
        type: object
    Record:
      properties:
        created_at:
          description: ISO 8601 formatted date-time indicating when the resource was created.
          example: '2018-02-02T22:25:27.521Z'
          readOnly: true
          type: string
        id:
          description: Identifies the resource.
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
          format: uuid
          readOnly: true
          type: string
        record_type:
          description: Identifies the type of the resource.
          example: sample_record_type
          readOnly: true
          type: string
        updated_at:
          description: ISO 8601 formatted date-time indicating when the resource was updated.
          example: '2018-02-02T22:25:27.521Z'
          readOnly: true
          type: string
      type: object
    netapps_Error:
      properties:
        code:
          type: string
        detail:
          type: string
        meta:
          additionalProperties: true
          type: object
        source:
          properties:
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
          type: object
        title:
          type: string
      required:
      - code
      - title
      type: object
    NetworkCreate:
      allOf:
      - $ref: '#/components/schemas/Network'
      - required:
        - name
        title: NetworkCreate
        type: object
    DefaultGateway:
      allOf:
      - $ref: '#/components/schemas/Record'
      - properties:
          network_id:
            description: Network ID.
            example: e66c496d-4a85-423b-8b2a-8e63fac20320
            format: uuid
            readOnly: true
            type: string
          record_type:
            description: Identifies the type of the resource.
            example: default_gateway
            readOnly: true
            type: string
          status:
            $ref: '#/components/schemas/InterfaceStatus'
          wireguard_peer_id:
            description: Wireguard peer ID.
            example: e66c496d-4a85-423b-8b2a-8e63fac20320
            format: uuid
            type: string
        title: DefaultGateway
        type: object
    PaginationMeta:
      properties:
        page_number:
          example: 2
          type: integer
        page_size:
          example: 25
          type: integer
        total_pages:
          example: 3
          type: integer
        total_results:
          example: 55
          type: integer
      type: object
    Interface:
      properties:
        name:
          description: A user specified name for the interface.
          example: test interface
          type: string
        network_id:
          description: The id of the network associated with the interface.
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
          format: uuid
          type: string
        status:
          $ref: '#/components/schemas/InterfaceStatus'
      type: object
  parameters:
    PageConsolidated:
      description: 'Consolidated page parameter (deepObject style). Originally: page[number], page[size]'
      explode: true
      in: query
      name: page
      schema:
        properties:
          number:
            default: 1
            description: The page number to load
            minimum: 1
            type: integer
          size:
            default: 20
            description: The size of the page
            maximum: 250
            minimum: 1
            type: integer
        type: object
      style: deepObject
    ResourceId:
      description: Identifies the resource.
      in: path
      name: id
      required: true
      schema:
        example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        format: uuid
        type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    branded-calling_bearerAuth:
      description: API key passed as a Bearer token in the Authorization header
      scheme: bearer
      type: http
    oauthClientAuth:
      description: OAuth 2.0 authentication for Telnyx API and MCP integrations
      flows:
        authorizationCode:
          authorizationUrl: https://api.telnyx.com/v2/oauth/authorize
          refreshUrl: https://api.telnyx.com/v2/oauth/token
          scopes:
            admin: Administrative access to Telnyx resources
          tokenUrl: https://api.telnyx.com/v2/oauth/token
        clientCredentials:
          scopes:
            admin: Administrative access to Telnyx resources
          tokenUrl: https://api.telnyx.com/v2/oauth/token
      type: oauth2
    outbound-voice-profiles_bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http
    pronunciation-dicts_bearerAuth:
      description: Telnyx API v2 key. Obtain from https://portal.telnyx.com
      scheme: bearer
      type: http
    stored-payment-transactions_bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http