Agents API

List all phone numbers for a project

get
https://api.dev.poly.ai/v1/agents/{agentId}/telephony/phone-numbers

Query Parameters

connectorIdstring

Filter by connector ID

Path Parameters

agentIdstringrequired

Response

application/json

Successful response

GetPhoneNumbersResponse

Every phone number in the project, optionally filtered by connector.

phoneNumbersarray[object]required

A phone number owned by the project, plus the connector it routes incoming calls to.

Show Child Parameters
get/v1/agents/{agentId}/telephony/phone-numbers
 
application/json

Import phone numbers into a project

post
https://api.dev.poly.ai/v1/agents/{agentId}/telephony/phone-numbers

Path Parameters

agentIdstringrequired

Body

application/json

ImportPhoneNumbersBody

A batch of phone numbers to import, all sharing the same environment assignment.

phoneNumbersarray[string]required

List of phone numbers to import

>= 1 items

clientEnvstring

Client environment (sandbox, pre-release, live)

Default:live

Response

application/json

Successful response

ImportPhoneNumbersResponse

The set of phone numbers that were imported.

importedarray[string]required

List of successfully imported phone numbers

post/v1/agents/{agentId}/telephony/phone-numbers

Body

{ "phoneNumbers": [ "[]" ] }
 
application/json

Delete phone numbers from a project

delete
https://api.dev.poly.ai/v1/agents/{agentId}/telephony/phone-numbers

Path Parameters

agentIdstringrequired

Body

application/json

DeletePhoneNumbersBody

Phone numbers to release in a single call.

Releases are processed independently; see the response for per-number results.

phoneNumbersarray[string]required

List of phone numbers to delete

>= 1 items

Response

application/json

Successful response

DeletePhoneNumbersResponse

Per-number results of a batch release — phone numbers that were
successfully released, plus any that couldn’t be and why.

deletedarray[string]required

Successfully deleted phone numbers

errorsarray[object]

An error encountered while deleting a phone number in a batch.

Show Child Parameters
delete/v1/agents/{agentId}/telephony/phone-numbers

Body

{ "phoneNumbers": [ "[]" ] }
 
application/json

Batch get phone numbers

post
https://api.dev.poly.ai/v1/agents/{agentId}/telephony/phone-numbers/batch

Path Parameters

agentIdstringrequired

Body

application/json

BatchGetPhoneNumbersBody

Set of E.164 phone numbers to retrieve in a single call.

phoneNumbersarray[string]required

List of phone numbers to retrieve

>= 1 items

Response

application/json

Successful response

BatchGetPhoneNumbersResponse

Result of a batch phone-number lookup, partitioned into numbers that
were found and numbers that weren’t.

foundarray[object]required

A phone number owned by the project, plus the connector it routes incoming calls to.

Show Child Parameters
notFoundarray[string]required
post/v1/agents/{agentId}/telephony/phone-numbers/batch

Body

{ "phoneNumbers": [ "[]" ] }
 
application/json

Get a specific phone number

get
https://api.dev.poly.ai/v1/agents/{agentId}/telephony/phone-numbers/{phoneNumber}

Path Parameters

agentIdstringrequired
phoneNumberstringrequired

Response

application/json

Successful response

PhoneNumberResponse

A phone number owned by the project, plus the connector it routes incoming calls to.

numberstringrequired

Phone number in E.164 format

projectIdstringrequired

Project this number belongs to

accountIdstringrequired

Account this number belongs to

clientEnvstringrequired

Client environment (sandbox, pre-release, live)

connectorIdstring

Connector this number is routed to

get/v1/agents/{agentId}/telephony/phone-numbers/{phoneNumber}
 
application/json