update

View as MarkdownOpen in Claude

Partially update a SWML webhook resource. Uses PATCH for partial.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of a SWML Webhook.

Request

namestringOptional
Name of the SWML Webhook.
used_forenumOptionalDefaults to calling
Indicates whether this SWML Webhook handles inbound calls or inbound messages. Determines the payload SignalWire POSTs to `primary_request_url`.
Allowed values:
primary_request_urlstringOptionalformat: "uri"
Primary URL SignalWire fetches the SWML document from when the webhook fires. The webhook payload depends on `used_for`: for `calling`, see the [SWML inbound call webhook](/docs/apis/rest/webhooks/inbound-call-webhook); for `messaging`, see the [SWML inbound message webhook](/docs/apis/rest/webhooks/inbound-message-webhook).
primary_request_methodenumOptionalDefaults to POST
Primary request method of the SWML Webhook.
Allowed values:
fallback_request_urlstringOptionalformat: "uri"
Fallback URL SignalWire fetches the SWML document from if the primary URL fails. Receives the same payload as `primary_request_url` — see the [SWML inbound call webhook](/docs/apis/rest/webhooks/inbound-call-webhook) or [SWML inbound message webhook](/docs/apis/rest/webhooks/inbound-message-webhook) depending on `used_for`.
fallback_request_methodenumOptionalDefaults to POST
Fallback request method of the SWML Webhook.
Allowed values:
status_callback_urlstringOptionalformat: "uri"
URL to receive message status callback events for outbound messages sent by this webhook (`reply` or `send_sms`). See the [Message status callback](/docs/apis/rest/webhooks/message-status-callback) webhook for the payload your URL will receive.
status_callback_methodenumOptionalDefaults to POST
Status callback method of the SWML Webhook.
Allowed values:

Response

idstringRequiredformat: "uuid"
Unique ID of the SWML Webhook.
project_idstringRequiredformat: "uuid"
Unique ID of the Project.
display_namestringRequired
Display name of the SWML Webhook Fabric Resource
typeenumRequired
Type of the Fabric Resource
Allowed values:
created_atdatetimeRequired
Date and time when the resource was created.
updated_atdatetimeRequired
Date and time when the resource was updated.
swml_webhookobjectRequired
SWML Webhook data.

Response Example

Response
{
"id": "a87db7ed-8ebe-42e4-829f-8ba5a4152f54",
"project_id": "99151cf8-9548-4860-ba70-a8de824f3312",
"display_name": "Booking Assistant",
"type": "swml_webhook",
"created_at": "2024-05-06T12:20:00Z",
"updated_at": "2024-05-06T12:20:00Z",
"swml_webhook": {
"id": "a87db7ed-8ebe-42e4-829f-8ba5a4152f54",
"name": "My SWML Webhook",
"used_for": "calling",
"primary_request_url": "https://primary.com",
"primary_request_method": "GET",
"fallback_request_url": "https://fallback.com",
"fallback_request_method": "GET",
"status_callback_url": "https://callback.com",
"status_callback_method": "POST"
}
}

Example

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
updated = client.fabric.swml_webhooks.update("webhook-id", name="updated-name")
print(f"Updated: {updated['display_name']}")