Send call commands
Unified JSON-RPC style endpoint for executing call methods through command-based dispatch. Send a request with the appropriate command field to invoke the desired call operation. Only the commands listed below are supported. Most operate on an already-active call; dial creates a new one. All commands are sent over HTTP (no persistent WebSocket connection required) and return immediately; operations that continue asynchronously deliver their results to your status_url webhooks.
Use the Calling API for SWML-driven calls and command-based control. Integrations built around form-encoded cXML requests and Call SIDs should use the Compatibility API's Create a call and Update a call operations instead.
Supported Commands
Use one of the following commands in the command field of the request body to perform the corresponding action on an active call. For more details on each command, refer to the individual API reference documentation linked below.
| Command | Description |
|---|---|
| dial | Create and initiate a new outbound call |
| update | Modify an active call's dialplan in real-time |
| calling.end | Terminate an active call immediately |
| calling.transfer | Transfer a call to a new destination (SIP URI, phone number, or inline SWML) |
| calling.disconnect | Disconnect bridged calls without hanging up either leg |
| calling.play | Play audio, TTS, silence, or ringtone to a call |
| calling.play.pause | Pause active playback |
| calling.play.resume | Resume paused playback |
| calling.play.stop | Stop active playback |
| calling.play.volume | Adjust playback volume |
| calling.record | Start recording a call |
| calling.record.pause | Pause active recording |
| calling.record.resume | Resume paused recording |
| calling.record.stop | Stop active recording |
| calling.collect | Collect DTMF or speech input |
| calling.collect.stop | Stop active collection |
| calling.collect.start_input_timers | Start input timers on active collect |
| calling.detect | Start a detector (answering machine, fax, or digit) |
| calling.detect.stop | Stop active detector |
| calling.tap | Tap call audio to an RTP or WebSocket endpoint |
| calling.tap.stop | Stop active tap |
| calling.transcribe | Start background transcription of a call |
| calling.transcribe.stop | Stop active transcription |
| calling.stream | Stream call audio to a WebSocket endpoint |
| calling.stream.stop | Stop active stream |
| calling.denoise | Start noise reduction on a call |
| calling.denoise.stop | Stop noise reduction |
| calling.ai_hold | Place an AI call on hold |
| calling.ai_unhold | Resume an AI call from hold |
| calling.ai_message | Inject a message into an active AI conversation |
| calling.ai.stop | Stop an active AI session |
| calling.ai_sidecar | Attach a real-time AI observer (sidecar) to a call, or summarize the conversation |
| calling.ai_sidecar.poke | Send a message to the sidecar and prompt an immediate response |
| calling.ai_sidecar.ask | Ask the sidecar a one-off question (answered via an ask_answer callback) |
| calling.ai_sidecar.stop | Stop and detach the AI sidecar |
| calling.ai_sidecar.status | Get a snapshot of the sidecar's activity counters |
| calling.live_transcribe | Start, stop, or summarize real-time transcription |
| calling.live_translate | Start, stop, summarize, or inject real-time translation |
| calling.send_fax.stop | Stop active fax send |
| calling.receive_fax.stop | Stop active fax receive |
| calling.refer | Transfer a SIP call via SIP REFER |
| calling.user_event | Fire a custom user event on the call |
Permissions
The API token used to authenticate must have the following scope(s) enabled to make a successful request: Voice.
Learn more about API scopes.
Request body
Example request
{
"command": "dial",
"params": {
"from": "sip:from-sip@example-112233445566.sip.signalwire.com",
"to": "sip:from-sip@example-112233445567.sip.signalwire.com",
"username": "alice",
"password": "s3cr3t",
"caller_id": "+1234567890",
"fallback_url": "https://example.com/fallback",
"status_url": "https://example.com/status_callback",
"status_events": [
"answered",
"ended"
],
"url_method": "POST",
"timeout": 30,
"max_price_per_minute": 0.05,
"send_digits": "1234#",
"custom_variables": {
"id": "12345",
"case_number": "54321"
},
"url": "https://example.com/swml"
}
}Response
The request has succeeded.
Example response
{
"from": "+12069708643",
"to": "+15550198765",
"source": "realtime_api",
"created_at": "2024-05-06T12:20:00Z",
"charge_details": [
{
"description": "Outbound Voice",
"charge": 0.004
}
]
}Changes
Changed in 44 of the 137 revisions of this API.20169629398
- ▲
removed
SWML.Calling.SWMLObjectfrom theoneOf[subschema #1: dial]/params/anyOf[subschema #1: dial (URL)]/to_scriptrequest propertyanyOflistrequest-property-any-of-removed
- ▲
removed
SWML.Calling.SWMLObjectfrom theoneOf[subschema #1: dial]/params/anyOf[subschema #2: dial (Inline SWML)]/to_scriptrequest propertyanyOflistrequest-property-any-of-removed
- ▲
removed
SWML.Calling.SWMLObjectfrom theoneOf[subschema #38: calling.transfer]/params/destrequest propertyanyOflistrequest-property-any-of-removed
- ▲
the
oneOf[subschema #1: dial]/params/anyOf[subschema #2: dial (Inline SWML)]/swmlrequest property type/format changed from/toobject/request-property-type-changed
- ▲
the
oneOf[subschema #2: update]/params/anyOf[subschema #2: update (Inline SWML)]/swmlrequest property type/format changed from/toobject/request-property-type-changed
- ▲
added 'unevaluatedProperties' constraint to the request property
oneOf[subschema #1: dial]/params/anyOf[subschema #2: dial (Inline SWML)]/swmlrequest-property-unevaluated-properties-added
- ▲
added 'unevaluatedProperties' constraint to the request property
oneOf[subschema #2: update]/params/anyOf[subschema #2: update (Inline SWML)]/swmlrequest-property-unevaluated-properties-added
- ●
removed
SWML.Calling.SWMLObjectfrom theoneOf[subschema #1: dial]/params/anyOf[subschema #2: dial (Inline SWML)]/swmlrequest propertyallOflistrequest-property-all-of-removed
- ●
removed
SWML.Calling.SWMLObjectfrom theoneOf[subschema #2: update]/params/anyOf[subschema #2: update (Inline SWML)]/swmlrequest propertyallOflistrequest-property-all-of-removed
- ○
added
subschema #2to theoneOf[subschema #1: dial]/params/anyOf[subschema #1: dial (URL)]/to_scriptrequest propertyanyOflistrequest-property-any-of-added
- ○
added
subschema #2to theoneOf[subschema #1: dial]/params/anyOf[subschema #2: dial (Inline SWML)]/to_scriptrequest propertyanyOflistrequest-property-any-of-added
- ○
added
subschema #2to theoneOf[subschema #38: calling.transfer]/params/destrequest propertyanyOflistrequest-property-any-of-added
This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
Of the 137 revisions, 3 have a changelog that could not be searched.