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" |
incoming_text_webhook_url | string | No | HTTPS URL for inbound SMS/MMS webhook notifications |
filter_mode | string | No | "blacklist" (default) or "whitelist". Controls how contact rules are interpreted for this phone number. Requires an admin API key or Clerk JWT to set. |
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. |
incoming_text_webhook_url | string | null | No | HTTPS URL for inbound SMS/MMS webhook notifications. Set to null to unsubscribe. |
filter_mode | string | No | "blacklist" or "whitelist". Controls how contact rules are interpreted for this phone number. Admin API key or Clerk JWT required to change this field. |
Request example
Response (200)
Returns the updated phone number object. When this request changes filter_mode to a new value, the response also includes a filter_mode_change_notice object counting rules that are now redundant under the new mode (see the Phone number object below). The field is null on any other PATCH and on GET, list, and create responses.
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 |
incoming_text_webhook_url | string | null | HTTPS URL for inbound SMS/MMS webhook notifications |
filter_mode | string | "blacklist" (default) or "whitelist". Decides how contact rules are interpreted for inbound calls and texts. |
agent_identity_id | UUID | null | Agent identity that owns this number, or null if the number is standalone (not tied to any agent) |
created_at | string | Creation timestamp (ISO 8601) |
updated_at | string | Last updated timestamp (ISO 8601) |
filter_mode_change_notice | object | null | Populated only on PATCH responses where filter_mode was actually changed. null otherwise. See shape below. |
filter_mode_change_notice
| Field | Type | Description |
|---|---|---|
new_filter_mode | string | The mode the phone number was just flipped to ("whitelist" or "blacklist") |
redundant_rule_action | string | "block" when the new mode is whitelist; "allow" when the new mode is blacklist |
redundant_rule_count | integer | Number of active rules whose action equals redundant_rule_action. 0 is a clean flip; a value greater than 0 suggests the operator review or delete those rules. Paused and deleted rules are not counted. |
- Phone contact rules — the allow/block list interpreted by
filter_mode - Filtering guide — whitelist/blacklist walkthrough for mail and phone