Skip to main content
POST
/
v1
/
telephony
/
numbers
/
{id}
/
assign
Route a number to an agent
curl --request POST \
  --url https://api.pyai.com/v1/telephony/numbers/{id}/assign \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_id": "<string>"
}
'
{
  "object": "telephony.number",
  "id": "pn_...",
  "phone_number": "+14155550123",
  "country": "US",
  "area_code": "415",
  "capabilities": {
    "voice": true,
    "sms": true
  },
  "agent_id": "<string>",
  "recording": true,
  "monthly_cost_cents": 123,
  "created_at": 123,
  "released_at": 123
}

Authorizations

Authorization
string
header
required

Use Authorization: Bearer pyai_live_... (or pyai_test_...).

Path Parameters

id
string
required

Body

application/json
agent_id
string | null

Agent to bind, or null to unassign.

Response

Updated

object
string
Example:

"telephony.number"

id
string
Example:

"pn_..."

phone_number
string

E.164.

Example:

"+14155550123"

country
string
Example:

"US"

area_code
string | null
Example:

"415"

capabilities
object
agent_id
string | null

Agent that answers inbound calls to this number.

recording
boolean

Carrier-side recording — always false; calls are recorded in PyAI's media bridge.

monthly_cost_cents
integer
status
enum<string>
Available options:
active,
released
created_at
integer

Unix ms.

released_at
integer | null

Unix ms.