Twilio ByocTrunks API

The ByocTrunks API from Twilio — 2 operation(s) for byoctrunks.

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v1/ByocTrunks Create a BYOC trunk · Create byoc trunk #
Ask an LLM
“How do I connect my own carrier to Twilio with a new BYOC trunk?”
“Can I set a voice URL and a fallback URL when creating a BYOC trunk?”
Tell an agent
Create a BYOC trunk named {name} that sends calls to {voice_url}.
Create a BYOC trunk using connection policy {policy} with CNAM lookup {cnam}.
GET /v1/ByocTrunks List my BYOC trunks · List byoc trunk #
Ask an LLM
“Which Bring Your Own Carrier trunks do I have configured?”
“What BYOC trunks exist on my account?”
Tell an agent
List all my BYOC trunks.
Show BYOC trunks, {page_size} per page.
GET /v1/ByocTrunks/{Sid} View a BYOC trunk · Fetch byoc trunk #
Ask an LLM
“What voice URL and connection policy is a BYOC trunk using?”
“Can I pull up the settings of one BYOC trunk by SID?”
Tell an agent
Show BYOC trunk {trunk}.
Get the voice and status callback settings of trunk {trunk}.
POST /v1/ByocTrunks/{Sid} Change a BYOC trunk's settings · Update byoc trunk #
Ask an LLM
“Can I swap the connection policy on a BYOC trunk that already exists?”
“What do I change to point an existing trunk at a new voice webhook?”
Tell an agent
Change the voice URL of BYOC trunk {trunk} to {voice_url}.
Switch existing trunk {trunk} to connection policy {policy}.
DELETE /v1/ByocTrunks/{Sid} Delete a BYOC trunk · Delete byoc trunk #
Ask an LLM
“How do I remove a BYOC trunk for a carrier we stopped using?”
“Can I delete a Bring Your Own Carrier trunk entirely?”
Tell an agent destructive · confirm first
Delete BYOC trunk {trunk}.
Remove the carrier trunk {trunk} from my account.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/twilio:twilio-byoctrunks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

twilio-byoctrunks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Twilio - Voice Byoc Trunks API
  description: This is the public Twilio REST API.
  termsOfService: https://www.twilio.com/legal/tos
  contact:
    name: Twilio Support
    url: https://support.twilio.com
    email: support@twilio.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.52.0
servers:
- url: https://voice.twilio.com
tags:
- name: ByocTrunks
paths:
  /v1/ByocTrunks:
    servers:
    - url: https://voice.twilio.com
    description: BYOC Trunks allow you to bring your own voice carrier to Twilio, enabling your calls to use our Programmable Voice APIs.
    x-twilio:
      defaultOutputProperties:
      - sid
      - friendly_name
      - voice_url
      pathType: list
    post:
      description: ''
      tags:
      - ByocTrunks
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/voice.v1.byoc_trunk'
          description: Created
      security:
      - accountSid_authToken: []
      operationId: CreateByocTrunk
      x-maturity:
      - GA
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateByocTrunkRequest'
      summary: Create byoc trunk
      x-summary-source: derived
    get:
      description: ''
      tags:
      - ByocTrunks
      parameters:
      - name: PageSize
        in: query
        description: How many resources to return in each list page. The default is 50, and the maximum is 1000.
        schema:
          type: integer
          minimum: 1
          maximum: 1000
      - name: Page
        in: query
        description: The page index. This value is simply for client state.
        schema:
          type: integer
          minimum: 0
      - name: PageToken
        in: query
        description: The page token. This is provided by the API.
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListByocTrunkResponse'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: ListByocTrunk
      x-maturity:
      - GA
      summary: List byoc trunk
      x-summary-source: derived
  /v1/ByocTrunks/{Sid}:
    servers:
    - url: https://voice.twilio.com
    description: BYOC Trunks allow you to bring your own voice carrier to Twilio, enabling your calls to use our Programmable Voice APIs.
    x-twilio:
      defaultOutputProperties:
      - sid
      - friendly_name
      - voice_url
      pathType: instance
    get:
      description: ''
      tags:
      - ByocTrunks
      parameters:
      - name: Sid
        in: path
        description: The Twilio-provided string that uniquely identifies the BYOC Trunk resource to fetch.
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^BY[0-9a-fA-F]{32}$
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/voice.v1.byoc_trunk'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: FetchByocTrunk
      x-maturity:
      - GA
      summary: Fetch byoc trunk
      x-summary-source: derived
    post:
      description: ''
      tags:
      - ByocTrunks
      parameters:
      - name: Sid
        in: path
        description: The Twilio-provided string that uniquely identifies the BYOC Trunk resource to update.
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^BY[0-9a-fA-F]{32}$
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/voice.v1.byoc_trunk'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: UpdateByocTrunk
      x-maturity:
      - GA
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateByocTrunkRequest'
      summary: Update byoc trunk
      x-summary-source: derived
    delete:
      description: ''
      tags:
      - ByocTrunks
      parameters:
      - name: Sid
        in: path
        description: The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete.
        schema:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^BY[0-9a-fA-F]{32}$
        required: true
      responses:
        '204':
          description: The resource was deleted successfully.
      security:
      - accountSid_authToken: []
      operationId: DeleteByocTrunk
      x-maturity:
      - GA
      summary: Delete byoc trunk
      x-summary-source: derived
components:
  schemas:
    UpdateByocTrunkRequest:
      type: object
      properties:
        FriendlyName:
          type: string
          description: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
        VoiceUrl:
          type: string
          format: uri
          description: The URL we should call when the BYOC Trunk receives a call.
        VoiceMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: The HTTP method we should use to call `voice_url`
        VoiceFallbackUrl:
          type: string
          format: uri
          description: The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`.
        VoiceFallbackMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.'
        StatusCallbackUrl:
          type: string
          format: uri
          description: The URL that we should call to pass status parameters (such as call ended) to your application.
        StatusCallbackMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`.'
        CnamLookupEnabled:
          type: boolean
          description: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        ConnectionPolicySid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^NY[0-9a-fA-F]{32}$
          description: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        FromDomainSid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^SD[0-9a-fA-F]{32}$
          description: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
    CreateByocTrunkRequest:
      type: object
      properties:
        FriendlyName:
          type: string
          description: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
        VoiceUrl:
          type: string
          format: uri
          description: The URL we should call when the BYOC Trunk receives a call.
        VoiceMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.'
        VoiceFallbackUrl:
          type: string
          format: uri
          description: The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`.
        VoiceFallbackMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.'
        StatusCallbackUrl:
          type: string
          format: uri
          description: The URL that we should call to pass status parameters (such as call ended) to your application.
        StatusCallbackMethod:
          type: string
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`.'
        CnamLookupEnabled:
          type: boolean
          description: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        ConnectionPolicySid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^NY[0-9a-fA-F]{32}$
          description: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        FromDomainSid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^SD[0-9a-fA-F]{32}$
          description: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
    voice.v1.byoc_trunk:
      type: object
      properties:
        account_sid:
          type:
          - string
          - 'null'
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource.
        sid:
          type:
          - string
          - 'null'
          minLength: 34
          maxLength: 34
          pattern: ^BY[0-9a-fA-F]{32}$
          description: The unique string that that we created to identify the BYOC Trunk resource.
        friendly_name:
          type:
          - string
          - 'null'
          description: The string that you assigned to describe the resource.
        voice_url:
          type:
          - string
          - 'null'
          format: uri
          description: The URL we call using the `voice_method` when the BYOC Trunk receives a call.
          x-twilio:
            pii:
              handling: standard
              deleteSla: 30
        voice_method:
          type:
          - string
          - 'null'
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.'
        voice_fallback_url:
          type:
          - string
          - 'null'
          format: uri
          description: The URL that we call when an error occurs while retrieving or executing the TwiML requested from `voice_url`.
          x-twilio:
            pii:
              handling: standard
              deleteSla: 30
        voice_fallback_method:
          type:
          - string
          - 'null'
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: 'The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.'
        status_callback_url:
          type:
          - string
          - 'null'
          format: uri
          description: The URL that we call to pass status parameters (such as call ended) to your application.
          x-twilio:
            pii:
              handling: standard
              deleteSla: 30
        status_callback_method:
          type:
          - string
          - 'null'
          format: http-method
          enum:
          - HEAD
          - GET
          - POST
          - PATCH
          - PUT
          - DELETE
          description: The HTTP method we use to call `status_callback_url`. Either `GET` or `POST`.
        cnam_lookup_enabled:
          type:
          - boolean
          - 'null'
          description: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        connection_policy_sid:
          type:
          - string
          - 'null'
          minLength: 34
          maxLength: 34
          pattern: ^NY[0-9a-fA-F]{32}$
          description: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        from_domain_sid:
          type:
          - string
          - 'null'
          minLength: 34
          maxLength: 34
          pattern: ^SD[0-9a-fA-F]{32}$
          description: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
        date_created:
          type:
          - string
          - 'null'
          format: date-time
          description: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
        date_updated:
          type:
          - string
          - 'null'
          format: date-time
          description: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
        url:
          type:
          - string
          - 'null'
          format: uri
          description: The absolute URL of the resource.
    ListByocTrunkResponse:
      type: object
      properties:
        byoc_trunks:
          type: array
          items:
            $ref: '#/components/schemas/voice.v1.byoc_trunk'
        meta:
          type: object
          properties:
            first_page_url:
              type: string
              format: uri
            next_page_url:
              type:
              - string
              - 'null'
              format: uri
            page:
              type: integer
            page_size:
              type: integer
            previous_page_url:
              type:
              - string
              - 'null'
              format: uri
            url:
              type: string
              format: uri
            key:
              type: string
  securitySchemes:
    accountSid_authToken:
      type: http
      scheme: basic
x-maturity:
- name: GA
  description: This product is Generally Available.
- name: Beta
  description: PLEASE NOTE that this is a Beta product that is subject to change. Use it with caution.
- name: Preview
  description: PLEASE NOTE that this is a Preview product that is subject to change. Use it with caution. If you currently do not have developer preview access, please contact https://www.twilio.com/help/contact.