Skip to main content

Retrieve number list

Retrieve number list

GET
https://api.agora.io/api/conversational-ai-agent/v2/phone-numbers

Use this endpoint to retrieve a list of all imported phone numbers under the current account.

Response

  • If the returned status code is 200, the request was successful. The response body contains a JSON array of phone number configurations.

    Array of:
    • provider string

      Possible values: byo, twilio

      Number provider:

      • byo: BYO (Bring Your Own).
      • twilio: Twilio.
    • phone_number string

      A telephone number in E.164 format, used as a unique identifier.

    • label string

      A label used to identify the number.

    • inbound boolean

      Whether the number supports inbound calls.

    • outbound boolean

      Whether the number supports outbound calls.

    • associated_pipeline object

      The associated pipeline information. Returns null if no pipeline is associated.

      Show propertiesHide properties
      • pipeline_id string

        Pipeline ID.

      • pipeline_name string

        Pipeline name.

    • inbound_config object

      SIP inbound call configuration details. Returns null if not configured.

    • outbound_config object

      SIP outbound call configuration details. Returns null if not configured.

  • If the returned status code is not 200, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.

    Error Response
    • error_type string

      The type of error that occurred.

    • description string

      A detailed description of the error.

Authorization

This endpoint requires Basic Auth.

Request example


_3
curl --request GET \
_3
--url https://api.agora.io/api/conversational-ai-agent/v2/phone-numbers \
_3
--header 'Authorization: Basic <credentials>'

Response example


_23
[
_23
{
_23
"provider": "twilio",
_23
"phone_number": "+11234567890",
_23
"label": "Customer Support Line",
_23
"inbound": true,
_23
"outbound": true,
_23
"associated_pipeline": {
_23
"pipeline_id": "pipeline_0987654321fedcba",
_23
"pipeline_name": "Customer Service"
_23
}
_23
},
_23
{
_23
"provider": "byo",
_23
"phone_number": "+19876543210",
_23
"label": "Sales",
_23
"inbound": false,
_23
"outbound": true,
_23
"associated_pipeline": null,
_23
"inbound_config": {},
_23
"outbound_config": {}
_23
}
_23
]