Jump to
Phone Numbers
Manage the phone numbers associated with your organization. Provision toll-free or local numbers via Telnyx, configure how incoming calls are handled, and release numbers when no longer needed.
Provision phone number POST
POST /numbersProvision a new phone number for your organization. Searches available Telnyx inventory, places an order, and registers the number to your account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
agent_handle | string | Yes | Agent identity handle to assign this number to (e.g. "sales-agent" or "@sales-agent"). Leading @ is stripped. |
type | string | No | "toll_free" (default) or "local" |
state | string | No | US state code (e.g. "NY"). Only applicable when type is "local" |
incoming_call_action | string | No | How to handle incoming calls: "auto_accept", "auto_reject" (default), or "webhook" |
client_websocket_url | string | No | WebSocket URL (wss://) that Inkbox connects to when a call starts. Can carry text or audio, depending on how the connection is configured. Required when incoming_call_action is "auto_accept" |
incoming_call_webhook_url | string | No | HTTPS URL for incoming call webhooks. Required when incoming_call_action is "webhook" |
Request example
Response (201)
New numbers are provisioned with incoming_call_action set to auto_reject. Update the number to configure how incoming calls are handled.
Error responses
| Status | Description |
|---|---|
| 404 | No available numbers matching the criteria |
| 429 | Organization already has 3 active phone numbers. Release an existing number before provisioning a new one |
| 502 | Telnyx provisioning failed |
Code examples
Release phone number DELETE
DELETE /numbers/{phone_number_id}Release a phone number from your organization. The number is deleted in Inkbox with status released and unlinked from any identity. Returns 204 No Content on success.
Caution: Releasing a number is irreversible. The number is returned to the carrier pool and you may not be able to reclaim it.
Path parameters
| Parameter | Type | Description |
|---|---|---|
phone_number_id | UUID | Unique identifier of the phone number to release |
Response (204)
Returns no content.
Error responses
| Status | Description |
|---|---|
| 403 | Number does not belong to your organization |
| 404 | Phone number not found |
Code examples
List phone numbers GET
GET /numbersList all phone numbers for your organization.
Response (200)
Code examples
Get phone number GET
GET /numbers/{phone_number_id}Get a single phone number by ID.
Path parameters
| Parameter | Type | Description |
|---|---|---|
phone_number_id | UUID | Unique identifier of the phone number |
Response (200)
Returns a phone number object.
Error responses
| Status | Description |
|---|---|
| 403 | Number does not belong to your organization |
| 404 | Phone number not found |
Code examples
Update phone number PATCH
PATCH /numbers/{phone_number_id}Update the configuration for a phone number. All fields are optional — only the fields you provide will be updated.
Path parameters
| Parameter | Type | Description |
|---|---|---|
phone_number_id | UUID | Unique identifier of the phone number |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
incoming_call_action | string | No | How to handle incoming calls: "auto_accept", "auto_reject", or "webhook" |
client_websocket_url | string | No | WebSocket URL (wss://) that Inkbox connects to when a call starts. Can carry text or audio, depending on how the connection is configured. Required when incoming_call_action is "auto_accept" |
incoming_call_webhook_url | string | null | No | HTTPS URL for incoming call webhooks. Required when incoming_call_action is "webhook". Set to null to unsubscribe. |
Request example
Response (200)
Returns the updated phone number object.
Error responses
| Status | Description |
|---|---|
| 403 | Number does not belong to your organization |
| 404 | Phone number not found |
Code examples
Phone number object
| Field | Type | Description |
|---|---|---|
id | UUID | Unique phone number identifier |
number | string | Phone number in E.164 format (e.g. "+14155550100") |
type | string | Number type: "toll_free" or "local" |
status | string | Lifecycle status: "active", "paused", or "released" |
incoming_call_action | string | How incoming calls are handled: "auto_accept", "auto_reject", or "webhook" |
client_websocket_url | string | null | WebSocket URL used for auto-accepted calls |
incoming_call_webhook_url | string | null | HTTPS URL for incoming call webhook notifications |
created_at | string | Creation timestamp (ISO 8601) |
updated_at | string | Last updated timestamp (ISO 8601) |