---
title: "Create cXML webhook"
method: POST
path: "/api/fabric/resources/cxml_webhooks"
tags: ["cXML Webhook"]
---

# Create cXML webhook

`POST /api/fabric/resources/cxml_webhooks`

Creates a resource that requests cXML from your server when the handler runs. Use it when call or message instructions depend on current application state; use [Create cXML Script](/docs/apis/rest/cxml-scripts/create-cxml-script) when the cXML can be stored in SignalWire, or [Create SWML webhook](/docs/apis/rest/swml-webhook/create-swml-webhook) when the server returns SWML.

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_, _Messaging_, _Fax_, or _Video_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

## Request body

- CXMLWebhookCreateRequest
  - `name` string — Name of the CXML Webhook.
  - `used_for` 'calling' | 'messaging' — Sets the handler to handle incoming `calls` or `messages`.
  - `primary_request_url` string, uri, required — Primary request url of the CXML Webhook.
  - `primary_request_method` 'GET' | 'POST' — The method type to use for the URL
  - `fallback_request_url` string, uri — Fallback request url of the CXML Webhook.
  - `fallback_request_method` 'GET' | 'POST' — The method type to use for the URL
  - `status_callback_url` string, uri — Status callback url of the CXML Webhook.
  - `status_callback_method` 'GET' | 'POST' — The method type to use for the URL

## Response `201`

The request has succeeded and a new resource has been created as a result.

- CXMLWebhookResponse
  - `id` string, uuid, required — Universal Unique Identifier.
  - `project_id` string, uuid, required — Universal Unique Identifier.
  - `display_name` string, required — Display name of the CXMLWebhook Fabric Resource
  - `type` 'cxml_webhook', required — Type of the Fabric Resource
  - `created_at` string, date-time, required — Date and time when the resource was created.
  - `updated_at` string, date-time, required — Date and time when the resource was updated.
  - `cxml_webhook` CXMLWebhook, required
    - `id` string, uuid, required — Universal Unique Identifier.
    - `name` string, required — Name of the CXML Webhook.
    - `used_for` 'calling' | 'messaging', required — Sets the handler to handle incoming `calls` or `messages`.
    - `primary_request_url` string, uri, required — Primary request url of the CXML Webhook.
    - `primary_request_method` 'GET' | 'POST', required — The method type to use for the URL
    - `fallback_request_url` string, uri, nullable, required — Fallback request url of the CXML Webhook.
    - `fallback_request_method` 'GET' | 'POST', required — The method type to use for the URL
    - `status_callback_url` string, uri, nullable, required — Status callback url of the CXML Webhook.
    - `status_callback_method` 'GET' | 'POST', required — The method type to use for the URL

## Other responses

- `401` — Access is unauthorized.
- `404` — The server cannot find the requested resource.
- `422` — The request contains invalid parameters. See errors for details.
- `500` — An internal server error occurred.

---

[API](https://skmtc.dev/signalwire/apis/signalwire-rest-api.md) · [All operations](https://skmtc.dev/signalwire/apis/signalwire-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/signalwire/signalwire-rest-api/revisions/792d5b8e2970/schema)
