REST ClientPhone Numbers

update

View as MarkdownOpen in Claude

Update configuration for a phone number. Uses PUT.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of the phone number.

Request

namestringOptional
The friendly name for the phone number.
call_handlerenumOptional
The call handler for the phone number.
call_receive_modestringOptional
The call receive mode for the phone number.
call_request_urlstringOptional
The call request URL for the phone number.
call_request_methodenumOptional
The call request method for the phone number.
Allowed values:
call_fallback_urlstringOptional
The call fallback URL for the phone number.
call_fallback_methodenumOptional
The call fallback method for the phone number.
Allowed values:
call_status_callback_urlstringOptional
The call status callback URL for the phone number.
call_status_callback_methodenumOptional
The call status callback method for the phone number.
Allowed values:
call_laml_application_idstringOptional
The ID of the LaML Application to use when using the laml_application call handler.
call_dialogflow_agent_idstringOptional
The ID of the Dialogflow Agent to start when using the dialogflow call handler.
call_relay_topicstringOptional
A string representing the Relay topic to forward incoming calls to.
call_relay_topic_status_callback_urlstringOptional
A string representing a URL to send status change messages to when call_handler is set to relay_topic.
call_relay_script_urlstringOptional
The URL to make a request to when using the relay_script call handler.
call_relay_applicationstringOptional
A string representing the Relay Application to forward incoming calls to.
call_relay_connector_idstringOptional
The ID of the Relay Connector to use when using the relay_connector call handler.
call_sip_endpoint_idstringOptional
The ID of the SIP Endpoint to use when using the relay_sip_endpoint call handler.
call_verto_resourcestringOptional
The Verto resource to use when using the relay_verto_endpoint call handler.
call_video_room_idstringOptionalformat: "uuid"
The ID of the Video Room to forward incoming calls to when using the video_room call handler.
message_handlerenumOptional
The message handler for the phone number.
Allowed values:
message_request_urlstringOptional
The message request URL for the phone number.
message_request_methodenumOptional
The message request method for the phone number.
Allowed values:
message_fallback_urlstringOptional
The message fallback URL for the phone number.
message_fallback_methodenumOptional
The message fallback method for the phone number.
Allowed values:
message_laml_application_idstringOptional
The ID of the LaML Application to use for messages.
message_relay_topicstringOptional
A string representing the Relay topic to forward incoming messages to.
message_relay_applicationstringOptional
A string representing the Relay Application to forward incoming messages to.
call_relay_contextstringOptionalDeprecated
This handler type is deprecated. Please use call_relay_application or call_relay_topic instead.
call_relay_context_status_callback_urlstringOptionalDeprecated
This property is deprecated. Please use call_relay_topic_status_callback_url instead.
message_relay_contextstringOptionalDeprecated
This handler type is deprecated. Please use message_relay_application or message_relay_topic instead.

Response

idstringRequiredformat: "uuid"
The unique identifier of the phone number.
numberstringRequired
The phone number in E.164 format.
namestring or nullRequired
The name given to the phone number. Helps to distinguish different phone numbers within your project.
capabilitieslist of enumsRequired
A list of communication methods this phone number supports.
Allowed values:
number_typeenumRequired
The type of number this is defined as.
Allowed values:
e911_address_idstring or nullRequiredformat: "uuid"
The E911 address ID associated with this phone number.
created_atdatetimeRequired
The date the number was added to your project.
updated_atdatetimeRequired
The date the number was last updated.
next_billed_atdatetime or nullRequired
The next date the number will be billed for.
call_handlerenum or nullRequired
What type of handler you want to run on inbound calls.
calling_handler_resource_idstring or nullRequiredformat: "uuid"
The unique identifier of the calling handler resource.
call_receive_modeenumRequired
How do you want to receive the incoming call.
Allowed values:
call_request_urlstring or nullRequired
The URL to make a request to when using the laml_webhooks call handler.
call_request_methodenum or nullRequired
The HTTP method to use when making a request to the call_request_url.
Allowed values:
call_fallback_urlstring or nullRequired
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 nullRequired
The HTTP method to use when making a request to the call_fallback_url.
Allowed values:
call_status_callback_urlstring or nullRequired
The URL to make status callbacks to when using the laml_webhooks call handler.
call_status_callback_methodenum or nullRequired
The HTTP method to use when making a request to the call_status_callback_url.
Allowed values:
call_laml_application_idstring or nullRequired
The ID of the LaML Application to use when using the laml_application call handler.
call_dialogflow_agent_idstring or nullRequired
The ID of the Dialogflow Agent to start when using the dialogflow call handler.
call_relay_topicstring or nullRequired
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 nullRequired
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 nullRequired
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 nullRequired
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 nullRequired
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 nullRequired
The name of the Relay Application to send this call to when using the relay_application call handler.
call_relay_connector_idstring or nullRequired
The ID of the Relay Connector to send this call to when using the relay_connector call handler.
call_sip_endpoint_idstring or nullRequiredformat: "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 nullRequired
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 nullRequiredformat: "uuid"
The ID of the Video Room to send this call to when using the video_room call handler.
message_handlerenum or nullRequired
What type of handler you want to run on inbound messages.
Allowed values:
messaging_handler_resource_idstring or nullRequiredformat: "uuid"
The unique identifier of the messaging handler resource.
message_request_urlstring or nullRequired
The URL to make a request to when using the laml_webhooks message handler.
message_request_methodenum or nullRequired
The HTTP method to use when making a request to the message_request_url.
Allowed values:
message_fallback_urlstring or nullRequired
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 nullRequired
The HTTP method to use when making a request to the message_fallback_url.
Allowed values:
message_laml_application_idstring or nullRequired
The ID of the LaML Application to use when using the laml_application message handler.
message_relay_topicstring or nullRequired
The name of the Relay Topic to send this message to when using the relay_topic message handler.
message_relay_contextstring or nullRequired
The name of the Relay Context to send this message to when using the relay_context message handler.
country_codestring or nullRequired
The ISO 3166-1 alpha-2 country code of the phone number.

Response Example

Response
1{
2 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3 "number": "+15558675309",
4 "name": "Jenny",
5 "capabilities": [
6 "voice"
7 ],
8 "number_type": "toll-free",
9 "e911_address_id": "string",
10 "created_at": "2024-01-15T09:30:00Z",
11 "updated_at": "2024-01-15T09:30:00Z",
12 "next_billed_at": "2024-01-15T09:30:00Z",
13 "call_handler": "relay_context",
14 "calling_handler_resource_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
15 "call_receive_mode": "voice",
16 "call_request_url": "string",
17 "call_request_method": "POST",
18 "call_fallback_url": "string",
19 "call_fallback_method": "POST",
20 "call_status_callback_url": "string",
21 "call_status_callback_method": "POST",
22 "call_laml_application_id": "string",
23 "call_dialogflow_agent_id": "string",
24 "call_relay_topic": "office",
25 "call_relay_topic_status_callback_url": "https://myapplication/handle_relay_callbacks",
26 "call_relay_script_url": "https://example.signalwire.com/relay-bins/60e2ba7b-366e-44de-84e3-0c76cfccf1cc",
27 "call_relay_context": "my_relay_app",
28 "call_relay_context_status_callback_url": "https://myapplication/handle_relay_callbacks",
29 "call_relay_application": "my_relay_app",
30 "call_relay_connector_id": "string",
31 "call_sip_endpoint_id": "string",
32 "call_verto_resource": "string",
33 "call_video_room_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
34 "message_handler": "relay_application",
35 "messaging_handler_resource_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
36 "message_request_url": "string",
37 "message_request_method": "POST",
38 "message_fallback_url": "string",
39 "message_fallback_method": "POST",
40 "message_laml_application_id": "string",
41 "message_relay_topic": "string",
42 "message_relay_context": "my_relay_app",
43 "country_code": "US"
44}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9client.phone_numbers.update("phone-number-id", name="Support Line")