Phone numbers are the gateway for calls to reach your AI agents. You can provision new numbers and assign them to specific agents for inbound and outbound calls.
Endpoints
| Method | Endpoint | Description |
|---|
GET | /v1/orgs/:org_id/phone-numbers | List phone numbers |
POST | /v1/orgs/:org_id/phone-numbers | Provision a new number |
GET | /v1/orgs/:org_id/phone-numbers/:id | Get phone number details |
PATCH | /v1/orgs/:org_id/phone-numbers/:id | Update phone number |
DELETE | /v1/orgs/:org_id/phone-numbers/:id | Release phone number |
Phone Number Object
{
"id": 101,
"number": "+14155551234",
"status": "active",
"inbound_agent_id": 12,
"outbound_agent_id": null
}
| Field | Type | Description |
|---|
id | integer | Unique identifier |
number | string | E.164 formatted phone number |
status | string | Status: active, pending, released |
inbound_agent_id | integer | null | Agent that handles incoming calls |
outbound_agent_id | integer | null | Default agent for outbound calls |
List Phone Numbers
Retrieve all phone numbers in your organization.
curl https://api.thunderphone.com/v1/orgs/{org_id}/phone-numbers \
-H "Authorization: Token YOUR_API_TOKEN"
Provision a Phone Number
Request a new phone number for your organization.
curl -X POST https://api.thunderphone.com/v1/orgs/{org_id}/phone-numbers \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inbound_agent_id": 12
}'
Response
{
"id": 101,
"number": "+14155551234",
"status": "active",
"inbound_agent_id": 12,
"outbound_agent_id": null
}
Update Phone Number
Change the agents assigned to a phone number.
curl -X PATCH https://api.thunderphone.com/v1/orgs/{org_id}/phone-numbers/101 \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inbound_agent_id": 15,
"outbound_agent_id": 16
}'
Delete Phone Number
Release a phone number from your organization.
Releasing a phone number is permanent. The number may become available to other users.
curl -X DELETE https://api.thunderphone.com/v1/orgs/{org_id}/phone-numbers/101 \
-H "Authorization: Token YOUR_API_TOKEN"
Response: 204 No Content