SWML Webhook
SWML inbound call webhook
Payload sent by SignalWire to a SWML calling webhook URL when SWML is fetched for a call. This includes inbound calls arriving on a phone number configured with a SWML calling handler, and outbound REST-initiated calls that point at a SWML URL. The same payload shape is also used when the SWML calling transfer or execute method targets an external URL — in those cases, the params object carries the values supplied to that step.
The webhook URL is expected to respond with the SWML document to execute for the call.
postWebhookinboundCallWebhook
Payload
Example payload
{
"call": {
"call_id": "c2d3e4f5-a6b7-8901-cdef-234567890abc",
"node_id": "a1b2c3d4-1111-2222-3333-444455556666",
"segment_id": "d3e4f5a6-b7c8-9012-defa-345678901bcd",
"tag": "support-queue",
"call_state": "created",
"direction": "inbound",
"type": "sip",
"from": "sip:user@example.com",
"to": "sip:destination@yourdomain.com",
"from_number": "+12223334444",
"to_number": "+12223334445",
"dial_winner": "true",
"headers": [],
"parent": {
"device_type": "phone",
"call_id": "a1b2c3d4-1111-2222-3333-444455556666",
"node_id": "a1b2c3d4-1111-2222-3333-444455556666"
},
"peer": {
"call_id": "a1b2c3d4-1111-2222-3333-444455556666",
"node_id": "a1b2c3d4-1111-2222-3333-444455556666"
},
"sip_data": {
"sip_req_host": "yourdomain.com",
"sip_req_uri": "destination@yourdomain.com",
"sip_req_user": "destination",
"sip_from_host": "example.com",
"sip_from_uri": "user@example.com",
"sip_from_user": "user",
"sip_to_host": "yourdomain.com",
"sip_to_uri": "destination@yourdomain.com",
"sip_to_user": "destination",
"sip_contact_user": "user",
"sip_contact_port": "5060",
"sip_contact_uri": "user@192.168.1.100:5060",
"sip_contact_host": "192.168.1.100",
"sip_contact_params": {}
},
"project_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"space_id": "d3e4f5a6-b7c8-9012-defa-345678901bcd"
},
"vars": {
"user_selection": "1"
},
"envs": {
"api_key": "<YOUR_API_KEY>",
"webhook_url": "https://example.com/webhook",
"id": "12345",
"case_number": "54321"
},
"params": {
"department": "sales"
}
}Response
Webhook received