> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# setCxmlWebhook

> Route inbound calls to a cXML (LAML) webhook.

[update]: /docs/server-sdks/reference/typescript/rest/phone-numbers/update

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`][update] that sets `call_handler` to
`laml_webhooks` and populates the URL fields for you.

<Note>
  For SWML webhooks, use
  [`setSwmlWebhook`](/docs/server-sdks/reference/typescript/rest/phone-numbers/set-swml-webhook)
  instead.
</Note>

## **Parameters**

<ParamField path="resourceId" type="string" required={true} toc={true}>
  ID of the phone number to bind.
</ParamField>

<ParamField path="params" type="SetCxmlWebhookParams" required={true} toc={true}>
  Webhook URL and options.
</ParamField>

<ParamField path="params.url" type="string" required={true} toc={true}>
  Primary cXML document URL. Serialized as `call_request_url`.
</ParamField>

<ParamField path="params.fallbackUrl" type="string" toc={true}>
  Fallback URL invoked when the primary URL fails. Serialized as
  `call_fallback_url`.
</ParamField>

<ParamField path="params.statusCallbackUrl" type="string" toc={true}>
  URL that receives call-status updates. Serialized as
  `call_status_callback_url`.
</ParamField>

## **Returns**

`Promise<any>` — The updated phone-number resource.

## **Example**

```typescript {9-12}
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", {
  url: "https://example.com/voice.xml",
  fallbackUrl: "https://example.com/fallback.xml",
  statusCallbackUrl: "https://example.com/status",
});
```