Skip to navigation

setCxmlWebhook

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 setSwmlWebhook instead.

Parameters

resourceId
stringRequired

ID of the phone number to bind.

url
stringRequired

Primary cXML document URL. Serialized as call_request_url.

fallback_url
string

Fallback URL invoked when the primary URL fails. Serialized as call_fallback_url.

status_callback_url
string

URL that receives call-status updates. Serialized as call_status_callback_url.

extra
Record<string, unknown>

Additional fields merged into the request body.

Returns

Promise<PhoneNumberResponse> — The updated phone-number resource.

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
await client.phoneNumbers.setCxmlWebhook(
"phone-number-id",
"https://example.com/voice.xml",
"https://example.com/fallback.xml",
"https://example.com/status",
);