Twilio Trunking API

The Trunking API from Twilio — 3 operation(s) for trunking.

Documentation

Specifications

Other Resources

OpenAPI Specification

twilio-trunking-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Twilio - Accounts A2p Trunking 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://accounts.twilio.com
tags:
- name: Trunking
paths:
  /v2/Trunking/Countries:
    servers:
    - url: https://pricing.twilio.com
    description: Trunking pricing by country
    x-twilio:
      defaultOutputProperties:
      - country
      - price_unit
      pathType: list
    get:
      description: ''
      tags:
      - Trunking
      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/ListTrunkingCountryResponse'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: ListTrunkingCountry
      x-maturity:
      - GA
  /v2/Trunking/Countries/{IsoCountry}:
    servers:
    - url: https://pricing.twilio.com
    description: Trunking pricing by country
    x-twilio:
      defaultOutputProperties:
      - country
      - price_unit
      pathType: instance
    get:
      description: Fetch a specific Country.
      tags:
      - Trunking
      parameters:
      - name: IsoCountry
        in: path
        description: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch.
        schema:
          type: string
          format: iso-country-code
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pricing.v2.trunking_country-instance'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: FetchTrunkingCountry
      x-maturity:
      - GA
  /v2/Trunking/Numbers/{DestinationNumber}:
    servers:
    - url: https://pricing.twilio.com
    description: Trunking pricing for a specific phone number
    x-twilio:
      defaultOutputProperties:
      - country
      - inbound_call_price
      - price_unit
      pathType: instance
    get:
      description: Fetch pricing information for a specific destination and, optionally, origination phone number.
      tags:
      - Trunking
      parameters:
      - name: DestinationNumber
        in: path
        description: The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number.
        schema:
          type: string
          format: phone-number
        required: true
      - name: OriginationNumber
        in: query
        description: The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number.
        schema:
          type: string
          format: phone-number
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pricing.v2.trunking_number'
          description: OK
      security:
      - accountSid_authToken: []
      operationId: FetchTrunkingNumber
      x-maturity:
      - GA
components:
  schemas:
    pricing.v2.trunking_country-instance:
      type: object
      properties:
        country:
          type: string
          nullable: true
          description: The name of the country.
        iso_country:
          type: string
          format: iso-country-code
          nullable: true
          description: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
        terminating_prefix_prices:
          type: array
          items:
            type: object
            format: outbound-prefix-price-with-origin
            properties:
              origination_prefixes:
                type: array
                items:
                  type: string
              destination_prefixes:
                type: array
                items:
                  type: string
              base_price:
                type: number
              current_price:
                type: number
              friendly_name:
                type: string
          nullable: true
          description: The list of [TerminatingPrefixPrice](https://www.twilio.com/docs/voice/pricing#outbound-prefix-price-with-origin) records.
        originating_call_prices:
          type: array
          items:
            type: object
            format: inbound-call-price
            properties:
              base_price:
                type: number
              current_price:
                type: number
              number_type:
                type: string
          nullable: true
          description: The list of [OriginatingCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) records.
        price_unit:
          type: string
          format: currency
          nullable: true
          description: The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the resource.
    pricing.v2.trunking_country:
      type: object
      properties:
        country:
          type: string
          nullable: true
          description: The name of the country.
        iso_country:
          type: string
          format: iso-country-code
          nullable: true
          description: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the resource.
    pricing.v2.trunking_number:
      type: object
      properties:
        destination_number:
          type: string
          format: phone-number
          nullable: true
          description: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
        origination_number:
          type: string
          format: phone-number
          nullable: true
          description: The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
        country:
          type: string
          nullable: true
          description: The name of the country.
        iso_country:
          type: string
          format: iso-country-code
          nullable: true
          description: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
        terminating_prefix_prices:
          type: array
          items:
            type: object
            format: outbound-prefix-price-with-origin
            properties:
              origination_prefixes:
                type: array
                items:
                  type: string
              destination_prefixes:
                type: array
                items:
                  type: string
              base_price:
                type: number
              current_price:
                type: number
              friendly_name:
                type: string
          nullable: true
        originating_call_price:
          type: object
          format: inbound-call-price
          properties:
            base_price:
              type: number
            current_price:
              type: number
            number_type:
              type: string
          nullable: true
          description: The [OriginatingCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record.
        price_unit:
          type: string
          format: currency
          nullable: true
          description: The currency in which prices are measured, specified in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the resource.
    ListTrunkingCountryResponse:
      type: object
      properties:
        countries:
          type: array
          items:
            $ref: '#/components/schemas/pricing.v2.trunking_country'
        meta:
          type: object
          properties:
            first_page_url:
              type: string
              format: uri
            next_page_url:
              type: string
              format: uri
              nullable: true
            page:
              type: integer
            page_size:
              type: integer
            previous_page_url:
              type: string
              format: uri
              nullable: true
            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.