Import a Phone Number

View as Markdown
Import a phone number hosted elsewhere into your SignalWire Space. **Note:** This is a **Partner API**. To enable it on your SignalWire Space, contact [Sales](https://signalwire.com/company/contact?utm_campaign=devex_sent_em). #### 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](/docs/platform/your-signalwire-api-space).

Authentication

AuthorizationBasic
SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

Request

This endpoint expects an object.
numberstringRequired5-30 characters

The phone number to import in E.164 format. Number must be between 5 and 30 characters with no special characters besides a leading +.

number_typeenumRequired
The type of phone number being imported.
Allowed values:
capabilitieslist of enumsOptional
The capabilities to enable for this phone number. Can include any combination of SMS, Voice, Fax, and MMS. If not provided, defaults to all capabilities.
Allowed values:

Response

The request has succeeded and a new resource has been created as a result.
idstringformat: "uuid"
The unique identifier of the phone number.
numberstring
The phone number in E.164 format.
namestring or null
The name given to the phone number. Helps to distinguish different phone numbers within your project.
capabilitieslist of enums
A list of communication methods this phone number supports.
Allowed values:
number_typeenum
The type of number this is defined as.
Allowed values:
e911_address_idstring or nullformat: "uuid"
The E911 address ID associated with this phone number.
created_atdatetime
The date the number was added to your project.
updated_atdatetime
The date the number was last updated.
next_billed_atdatetime or null
The next date the number will be billed for.
call_handlerenum or null
What type of handler you want to run on inbound calls.
calling_handler_resource_idstring or nullformat: "uuid"
The unique identifier of the calling handler resource.
call_receive_modeenum
How do you want to receive the incoming call.
Allowed values:
call_request_urlstring or null

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

call_request_methodenum or null

The HTTP method to use when making a request to the call_request_url.

Allowed values:
call_fallback_urlstring or null

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

call_fallback_methodenum or null

The HTTP method to use when making a request to the call_fallback_url.

Allowed values:
call_status_callback_urlstring or null

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

call_status_callback_methodenum or null

The HTTP method to use when making a request to the call_status_callback_url.

Allowed values:
call_laml_application_idstring or null

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

call_dialogflow_agent_idstring or null
The ID of the Dialogflow Agent to start when using the dialogflow call handler.
call_relay_topicstring or null

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 or null

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 or null

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 or null

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

call_relay_context_status_callback_urlstring or null

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 or null

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

call_relay_connector_idstring or null

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

call_sip_endpoint_idstring or nullformat: "uuid"

The ID of the Relay SIP Endpoint to send this call to when using the relay_sip_endpoint call handler.

call_verto_resourcestring or null

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

call_video_room_idstring or nullformat: "uuid"

The ID of the Video Room to send this call to when using the video_room call handler.

message_handlerenum or null
What type of handler you want to run on inbound messages.
Allowed values:
messaging_handler_resource_idstring or nullformat: "uuid"
The unique identifier of the messaging handler resource.
message_request_urlstring or null

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

message_request_methodenum or null

The HTTP method to use when making a request to the message_request_url.

Allowed values:
message_fallback_urlstring or null

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

message_fallback_methodenum or null

The HTTP method to use when making a request to the message_fallback_url.

Allowed values:
message_laml_application_idstring or null

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

message_relay_topicstring or null

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

message_relay_contextstring or null

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

country_codestring or null

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

Errors