Purchase a Phone Number
POST/phone_numbers
Purchase a number and add it to your project.
Permissions
The API token must include the following scopes: Numbers.
Request
- application/json
Body
required
The phone number in E164 format.
Responses
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
The unique identifier of the Phone Number on SignalWire. This can be used to find, update or delete the phone number programmatically.
The phone number in E164 format.
The name given to the phone number. Helps to distinguish different phone numbers within your project.
Possible values: [relay_script
, relay_context
, relay_application
, laml_webhooks
, laml_application
, dialogflow
, relay_connector
, relay_sip_endpoint
, relay_verto_endpoint
, video_room
]
What type of handler you want to run on inbound calls.
How do you want to receive the incoming call. Possible values are: voice
or fax
. Default is voice
.
The URL to make a request to when using the laml_webhooks
call handler.
The HTTP method to use when making a request to the call_request_url
. Possible values are: POST
or GET
. Default is POST
.
The fallback URL to make a request to when using the laml_webhooks
call handler and the call_request_url
fails.
The HTTP method to use when making a request to the call_fallback_url
. Possible values are: POST
or GET
. Default is POST
.
The URL to make status callbacks to when using the laml_webhooks
call handler.
The HTTP method to use when making a request to the call_status_callback_url
. Possible values are: POST
or GET
. Default is POST
.
The ID of the LaML Application to use when using the laml_application
call handler.
The ID of the Dialogflow Agent to start when using the dialogflow
call handler.
The name of the Relay Context to send this call to when using the relay_context
call handler. Alias of message_relay_application
. If both are sent, call_relay_application
takes precedence.
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
.
The name of the Relay Application to send this call to when using the relay_application
call handler. Alias of message_relay_context
. If both are sent, call_relay_application
takes precedence.
The ID of the Relay Connector to send this call to when using the relay_connector
call handler.
The ID of the Relay SIP Endpoint to send this call to when using the relay_sip_endpoint
call handler.
The name of the Verto Relay Endpoint to send this call to when using the relay_verto_endpoint
call handler.
The ID of the Video Room to send this call to when using the video_room
call handler.
What type of handler you want to run on inbound messages. Possible values are: relay_context
, relay_application
, laml_webhooks
, laml_application
.
The URL to make a request to when using the laml_webhooks
message handler.
The HTTP method to use when making a request to the message_request_url
. Possible values are: POST
or GET
. Default is POST
.
The fallback URL to make a request to when using the laml_webhooks
message handler and the message_request_url
fails.
The HTTP method to use when making a request to the message_fallback_url
. Possible values are: POST
or GET
. Default is POST
.
The ID of the LaML Application to use when using the laml_application
message handler.
The name of the Relay Context to send this message to when using the relay_context
message handler. Alias of message_relay_application
. If both are sent, message_relay_application
takes precedence.
The name of the Relay Application to send this message to when using the relay_application
message handler. Alias of message_relay_context
. If both are sent, message_relay_application
takes precedence.
A list of communication methods this phone number supports. Possible values are: voice
, fax
, sms
, mms
.
The type of number this is defined as. Possible values are: toll-free
or longcode
.
A list of communication methods this phone number supports.
The date the number was added to your project.
The date the number was last updated.
The next date the number will be billed for.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number": "+15558675309",
"name": "Jenny",
"call_handler": "relay_context",
"call_receive_mode": "voice",
"call_request_url": "",
"call_request_method": "POST",
"call_fallback_url": "",
"call_fallback_method": "POST",
"call_status_callback_url": "",
"call_status_callback_method": "POST",
"call_laml_application_id": null,
"call_dialogflow_agent_id": null,
"call_relay_context": "my_relay_app",
"call_relay_context_status_callback_url": "https://myapplication/handle_relay_callbacks",
"call_relay_application": "my_relay_app",
"call_relay_connector_id": null,
"call_sip_endpoint_id": null,
"call_verto_resource": "",
"call_video_room_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
"message_handler": "relay_application",
"message_request_url": "",
"message_request_method": "POST",
"message_fallback_url": "",
"message_fallback_method": "POST",
"message_laml_application_id": "null",
"message_relay_context": "my_relay_app",
"message_relay_application": "my_relay_app",
"capabilities": [
"voice",
"sms",
"mms",
"fax"
],
"number_type": "toll-free",
"e911_address_id": null,
"created_at": "2024-07-29T15:51:28.071Z",
"updated_at": "2024-07-29T15:51:28.071Z",
"next_billed_at": "2024-07-29T15:51:28.071Z"
}