create

View as MarkdownOpen in Claude

Create a new SWML webhook resource.

Request

primary_request_urlstringRequiredformat: "uri"
Primary request url of the SWML Webhook.
namestringOptional
Name of the SWML Webhook.
used_forenumOptionalDefaults to calling
Used for of the SWML Webhook.
Allowed values:
primary_request_methodenumOptional
Primary request method of the SWML Webhook.
fallback_request_urlstringOptionalformat: "uri"
Fallback request url of the SWML Webhook.
fallback_request_methodenumOptional
Fallback request method of the SWML Webhook.
status_callback_urlstringOptionalformat: "uri"
Status callback url of the SWML Webhook.
status_callback_methodenumOptional
Status callback method of the SWML Webhook.

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
1{
2 "id": "a87db7ed-8ebe-42e4-829f-8ba5a4152f54",
3 "project_id": "99151cf8-9548-4860-ba70-a8de824f3312",
4 "display_name": "Booking Assistant",
5 "type": "swml_webhook",
6 "created_at": "2024-05-06T12:20:00Z",
7 "updated_at": "2024-05-06T12:20:00Z",
8 "swml_webhook": {
9 "id": "a87db7ed-8ebe-42e4-829f-8ba5a4152f54",
10 "name": "My SWML Webhook",
11 "used_for": "calling",
12 "primary_request_url": "https://primary.com",
13 "primary_request_method": "GET",
14 "fallback_request_url": "https://fallback.com",
15 "fallback_request_method": "GET",
16 "status_callback_url": "https://callback.com",
17 "status_callback_method": "POST"
18 }
19}

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
9result = client.fabric.swml_webhooks.create(
10 name="my-webhook", primary_request_url="https://example.com/swml",
11)
12print(f"Created: {result['id']}")