REST ClientPhone Numbers

set_cxml_webhook

View as MarkdownOpen in Claude

Route inbound calls on this phone number to a cXML (Twilio-compat / LAML) webhook. Despite the wire value laml_webhooks being plural, this creates a single cxml_webhook Fabric resource on the server.

This is a typed wrapper over update that sets call_handler to laml_webhooks and populates the URL fields for you.

For SWML webhooks, use set_swml_webhook instead.

Parameters

resource_id
strRequired

ID of the phone number to bind.

url
strRequired

Primary cXML webhook URL.

fallback_url
Optional[str]

URL invoked when the primary URL fails.

status_callback_url
Optional[str]

URL that receives call-status updates.

**extra
Any

Additional fields forwarded to update.

Returns

dict — The updated phone number resource.

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.set_cxml_webhook(
10 "phone-number-id",
11 "https://example.com/cxml",
12 fallback_url="https://example.com/cxml-fallback",
13 status_callback_url="https://example.com/status",
14)