Skip to navigation

SWML inbound call webhook

View as MarkdownOpen in Claude

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.

Payload

The payload of this webhook request is an object.
callobjectRequired
The call that triggered this fetch.
varsobjectRequired

Script-scope variables for this call session. Empty on the initial document fetch.

envsobjectOptional

Environment variables available to this call’s SWML document, which you can reference as ${envs.<key>}. Combines the variables you’ve configured at the account or project level with any custom_variables you passed on the outbound Call commands request.

Keys are case-sensitive. When a custom_variables key exactly matches an account- or project-level variable, including case, the value from the request wins; if they differ only in case, both are kept as separate variables.

Not included on every request: treat a missing envs as a call with no environment variables.

paramsobjectOptional

Parameters passed via a SWML calling execute or transfer step. Included only when the step that requested this document passed params, so it is absent on the first document fetch for a call.

Response

200
Webhook received