v77

latestOpenAPI 3.1.0MITraw.githubusercontent.com2026-08-012528701.8 MB
Phone Numbers

Purchase phone number

Purchases a phone number.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Numbers.

Learn more about API scopes.

post/api/relay/rest/phone_numbers

Request body

numberstring required

The phone number in E164 format.

Example request

{
  "number": "+15558675309"
}

Response

The request has succeeded.

idstring uuid required

Universal Unique Identifier.

numberstring required

The phone number in E.164 format.

namestring nullable required

The name given to the phone number. Helps to distinguish different phone numbers within your project.

capabilitiesPhoneNumberCapability[] required

A list of communication methods this phone number supports.

number_type'toll-free' | 'longcode' required

Phone number type.

e911_address_idstring uuid required

Universal Unique Identifier.

e911_status'pending' | 'active' | 'failed' | 'pending_removal' | 'unregistered' required

E911 provisioning status of a phone number.

created_atstring date-time required

The date the number was added to your project.

updated_atstring date-time required

The date the number was last updated.

next_billed_atstring date-time nullable required

The next date the number will be billed for.

call_handler'relay_context' | 'relay_topic' | 'relay_script' | 'relay_application' | 'relay_connector' | 'relay_sip_endpoint' | 'relay_verto_endpoint' | 'laml_webhooks' | 'laml_application' | 'dialogflow' | 'video_room' | 'call_flow' | 'ai_agent' | 'fabric_subscriber' | 'sip_gateway' | 'call_queue' required

Call handler type for phone numbers.

calling_handler_resource_idstring uuid required

Universal Unique Identifier.

call_receive_mode'voice' | 'fax' required

Call receive mode.

call_request_urlstring nullable required

The URL to make a request to when using the laml_webhooks call handler.

call_request_method'GET' | 'POST' required

HTTP method type.

call_fallback_urlstring nullable required

The fallback URL to make a request to when using the laml_webhooks call handler and the call_request_url fails.

call_fallback_method'GET' | 'POST' required

HTTP method type.

call_status_callback_urlstring nullable required

The URL to make status callbacks to when using the laml_webhooks call handler.

call_status_callback_method'GET' | 'POST' required

HTTP method type.

call_laml_application_idstring nullable required

The ID of the LaML Application to use when using the laml_application call handler.

call_dialogflow_agent_idstring nullable required

The ID of the Dialogflow Agent to start when using the dialogflow call handler.

call_relay_topicstring nullable required

A string representing the Relay topic to forward incoming calls to. This is only used (and required) when call_handler is set to relay_topic.

call_relay_topic_status_callback_urlstring nullable required

A string representing a URL to send status change messages to. This is only used (and required) when call_handler is set to relay_topic.

call_relay_script_urlstring nullable required

The URL to make a request to when using the relay_script call handler. The URL must respond with a valid SWML script.

call_relay_contextstring nullable required

The name of the Relay Context to send this call to when using the relay_context call handler.

call_relay_context_status_callback_urlstring nullable required

A string representing a URL to send status change messages to. This is only used (and required) when call_handler is set to relay_context.

call_relay_applicationstring nullable required

The name of the Relay Application to send this call to when using the relay_application call handler.

call_relay_connector_idstring nullable required

The ID of the Relay Connector to send this call to when using the relay_connector call handler.

call_sip_endpoint_idstring uuid required

Universal Unique Identifier.

call_verto_resourcestring nullable required

The name of the Verto Relay Endpoint to send this call to when using the relay_verto_endpoint call handler.

call_video_room_idstring uuid required

Universal Unique Identifier.

message_handler'relay_context' | 'relay_topic' | 'relay_application' | 'laml_webhooks' | 'laml_application' required

Message handler type for phone numbers.

messaging_handler_resource_idstring uuid required

Universal Unique Identifier.

message_request_urlstring nullable required

The URL to make a request to when using the laml_webhooks message handler.

message_request_method'GET' | 'POST' required

HTTP method type.

message_fallback_urlstring nullable required

The fallback URL to make a request to when using the laml_webhooks message handler and the message_request_url fails.

message_fallback_method'GET' | 'POST' required

HTTP method type.

message_laml_application_idstring nullable required

The ID of the LaML Application to use when using the laml_application message handler.

message_relay_topicstring nullable required

The name of the Relay Topic to send this message to when using the relay_topic message handler.

message_relay_contextstring nullable required

The name of the Relay Context to send this message to when using the relay_context message handler.

country_codestring nullable required

The ISO 3166-1 alpha-2 country code of the phone number.

Example response

{
  "number": "+15558675309",
  "name": "Jenny",
  "call_relay_topic": "office",
  "call_relay_topic_status_callback_url": "https://myapplication/handle_relay_callbacks",
  "call_relay_script_url": "https://example.signalwire.com/relay-bins/60e2ba7b-366e-44de-84e3-0c76cfccf1cc",
  "call_relay_context": "my_relay_app",
  "call_relay_context_status_callback_url": "https://myapplication/handle_relay_callbacks",
  "call_relay_application": "my_relay_app",
  "message_relay_context": "my_relay_app",
  "country_code": "US"
}