Import number
https://api.agora.io/api/conversational-ai-agent/v2/phone-numbers
Use this endpoint to import a pre-configured phone number that can be used for inbound or outbound calls.
Request
Request body
Request Bodyrequired
- provider stringrequired
Possible values:
byo,twilioNumber provider:
byo: BYO (Bring Your Own)twilio: Twilio
- phone_number stringrequired
Telephone number in E.164 format.
- label stringrequired
A label used to identify the number.
- inbound_config objectnullable
SIP inbound call configuration.
Show propertiesHide properties
- allowed_addresses arrayrequired
List of allowed IP addresses. For example:
112.126.15.64/27.
Response
-
If the returned status code is
201, the request was successful. The response body contains the result of the request.Response Body
- phone_number string
A telephone number in E.164 format, used as a unique identifier.
- label string
A label used to identify the number.
- provider string
Number provider.
- inbound boolean
Whether the number supports inbound calls.
- outbound boolean
Whether the number supports outbound calls.
- associated_pipeline object
The associated pipeline information. Returns
nullif no pipeline is associated.Show propertiesHide properties
- pipeline_id string
Pipeline ID.
- pipeline_name string
Pipeline name.
- outbound_config object
The outbound configuration.
- outbound_config object
The outbound configuration.
-
If the returned status code is not
201, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.Common error codes:
400invalid_phone_format: Invalid phone number format (not in E.164 format).401unauthorized: Authentication failed, please check your credentials.409phone_number_exists: Phone number already exists, duplicate import not allowed.422unprocessable_content: Request format error or parameter validation failed.500internal_server_error: Internal server error.