Send call commands

View as MarkdownOpen in Claude
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](/docs/compatibility-api/rest/calls/create-a-call) and [Update a call](/docs/compatibility-api/rest/calls/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](/docs/platform/your-signalwire-api-space).

Authentication

AuthorizationBasic
SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

Request

This endpoint expects an object.
dialobjectRequired

Creates a new outbound call from from to to, handled by the SWML you supply — fetched from url or provided inline as swml. The response returns the new call immediately; the lifecycle events selected in status_events are delivered to status_url as the call progresses. This is the only command that does not take a call id.

OR
updateobjectRequired

Update a call in progress — cancel, complete, or redirect the SWML flow.

State-transition rules:

  • status: canceled is only valid while the leg is queued or ringing.
  • status: completed is only valid while the leg is answered (or in-progress).
  • Supplying url or swml (redirect) is only valid while the leg is answered.
  • Calls in terminal states (busy, failed, no-answer, canceled, completed) cannot be updated.
OR
calling.endobjectRequired

Ends the call. The optional reason selects the hangup cause reported for the call; omitted, the call ends as a normal hangup. To disconnect only the peer leg of a connected call and keep this leg up, use calling.disconnect instead.

OR
calling.disconnectobjectRequired

Disconnects the peer leg of a connected call — for example, one joined by the SWML connect method — while keeping this call leg active. The call must currently be connected. Otherwise, the HTTP response is still 200; the command failure is recorded asynchronously in the call event log with error code 409, rather than delivered to a status webhook. To end the call itself, use calling.end.

OR
calling.ai_holdobjectRequired

Places a call that is on a live AI agent session on hold. The optional prompt is spoken to the caller before hold begins, and timeout limits how long the hold lasts. Requires an active AI agent on the call; resume with calling.ai_unhold.

OR
calling.ai_unholdobjectRequired

Takes a call off AI hold and resumes the conversation with the AI agent. Takes no parameters; the call is addressed by id alone.

OR
calling.ai_messageobjectRequired

Injects a message into the conversation of the AI agent on the call — as the system, user, or assistant role — or resets the conversation state via reset. Requires an active AI agent session on the call.

OR
calling.ai.stopobjectRequired

Stops the AI agent running on the call. The call itself stays up — use it to take over with other call commands, or calling.end to hang up entirely.

OR
calling.ai_sidecarobjectRequired

Attaches a real-time AI observer (a sidecar) to an answered call. The sidecar listens to the conversation and streams advice to your application as webhook callbacks; it never speaks on the call. A call has at most one sidecar, addressed by id alone.

OR
calling.ai_sidecar.pokeobjectRequired
Sends a message to the attached sidecar and prompts it to respond right away, without waiting for the next customer turn.
OR
calling.ai_sidecar.askobjectRequired

Asks the attached sidecar a one-off question without affecting the live conversation. The HTTP response returns the call object and does not include an ask_id. If the sidecar was started with a callback url, the first callback for the request is ask_request, which carries the generated ask_id. The later ask_answer callback and any request, thought, tool_call, or tool_result callbacks triggered by the ask repeat that ID.

OR
calling.ai_sidecar.stopobjectRequired
Stops and detaches the AI sidecar from the call. The call and its conversation continue.
OR
calling.ai_sidecar.statusobjectRequired

Requests an internal snapshot of the attached sidecar’s activity counters. The HTTP response returns the call object and does not expose the requested snapshot. If the sidecar was started with a callback url, its final callback provides end-of-session totals such as tool calls, insights, and token usage; see the SWML ai_sidecar callback types.

OR
calling.playobjectRequired

Play media (audio files, text-to-speech, silence, or ringtones) on an active call.

The HTTP response confirms the command was accepted. Playback lifecycle is delivered asynchronously via the status_url webhook, with payloads of the form {control_id, call_id, node_id, state} where state is one of playing, paused, finished, or error.

OR
calling.play.pauseobjectRequired

Pauses playback started by calling.play, addressed by its control_id. Resume it with calling.play.resume.

OR
calling.play.resumeobjectRequired

Resumes playback previously paused with calling.play.pause, addressed by its control_id.

OR
calling.play.stopobjectRequired

Stops playback started by calling.play, addressed by its control_id. A finished state is delivered to the play operation’s status_url webhook.

OR
calling.play.volumeobjectRequired

Adjusts the volume of an active play operation, in dB, addressed by its control_id.

OR
calling.recordobjectRequired

Starts recording an active call. The HTTP response returns the call leg — the recording URL is not included. Recording runs asynchronously; provide status_url to receive a webhook when the recording finishes (with the final URL), or query the call’s events endpoint.

OR
calling.record.pauseobjectRequired

Pauses an active recording, addressed by its control_id. behavior selects whether the paused span is omitted from the file or kept as silence. Resume with calling.record.resume.

OR
calling.record.resumeobjectRequired

Resumes a recording previously paused with calling.record.pause, addressed by its control_id.

OR
calling.record.stopobjectRequired

Stops an active recording, addressed by its control_id. The finished recording’s URL is delivered to the record operation’s status_url webhook.

OR
calling.collectobjectRequired

Collect user input (DTMF digits, speech, or both) on an active call.

At least one of digits or speech must be provided. Results are delivered asynchronously via the status_url webhook. Digit events have the shape {control_id, call_id, node_id, result: {type:"digit", params: {digits, terminator}}} and speech events {..., result: {type:"speech", params: {text, confidence}}}.

When start_input_timers is false, the initial_timeout clock does not start until you send calling.collect.start_input_timers for the same control_id.

OR
calling.collect.stopobjectRequired

Stops an active collect operation, addressed by its control_id — including a continuous collect, which otherwise restarts after each result.

OR
calling.collect.start_input_timersobjectRequired

Starts the initial-timeout clock for a collect that was started with start_input_timers: false — for example, once a prompt has finished playing and the caller should now respond.

OR
calling.detectobjectRequired

Start detection (answering machine, fax tone, or DTMF digits) on an active call.

Detection runs asynchronously up to timeout seconds. Results are delivered via the status_url webhook.

OR
calling.detect.stopobjectRequired

Stops an active detect operation before its timeout elapses, addressed by its control_id.

OR
calling.tapobjectRequired

Capture audio from an active call and stream it to an external destination.

Audio is streamed via RTP (to a public IP/port) or WebSocket (to a ws:///wss:// URI). Stop the tap with calling.tap.stop using the same control_id.

OR
calling.tap.stopobjectRequired

Stops an active tap, addressed by its control_id, ending delivery of the call’s audio to the external RTP or WebSocket destination.

OR
calling.transcribeobjectRequired

Transcribe the entire call in the background.

The transcription covers the whole call and completes when the call ends. For real-time transcription, use calling.live_transcribe. Only one transcription can be active on a call at a time. Stop it with calling.transcribe.stop using the same control_id before starting another.

OR
calling.transcribe.stopobjectRequired

Stops the background transcription started by calling.transcribe, addressed by its control_id, without waiting for the call to end.

OR
calling.streamobjectRequired

Stream call audio to an external WebSocket endpoint.

Audio is sent to a wss:// URL; custom_parameters pass through to the endpoint as connection metadata. Stream lifecycle webhooks are delivered to status_url (default method POST). Stop the stream with calling.stream.stop using the same control_id.

OR
calling.stream.stopobjectRequired

Stops an active audio stream, addressed by its control_id, closing delivery to the WebSocket endpoint. The call itself continues.

OR
calling.denoiseobjectRequired

Enable noise reduction on an active call. Denoise is per-call (no control_id); a call has at most one active denoise filter. Use calling.denoise.stop to disable it.

OR
calling.denoise.stopobjectRequired

Disables the noise-reduction filter enabled by calling.denoise. Takes no parameters; denoise is per-call, addressed by id alone.

OR
calling.live_transcribeobjectRequired

Controls real-time transcription on the call. The action starts a session, requests an on-demand summary, or stops the session; transcription events and summaries are delivered to the webhook configured on the action. To transcribe the whole call in the background instead, use calling.transcribe.

OR
calling.live_translateobjectRequired

Controls real-time translation on the call. The action starts a session between two languages, requests an on-demand summary, injects a message to be translated and spoken, or stops the session; translation events are delivered to the configured webhook.

OR
calling.transferobjectRequired

Transfers the call to a new destination. Whatever the call is doing stops immediately and the destination’s SWML takes over; the call keeps the same id, and further commands can still be sent while it remains active.

OR
calling.send_fax.stopobjectRequired

Stops an in-progress fax send on the call, addressed by its control_id.

OR
calling.receive_fax.stopobjectRequired

Stops an in-progress fax receive on the call, addressed by its control_id.

OR
calling.referobjectRequired

Sends a SIP REFER on the call, asking the remote SIP endpoint to take the call to a new SIP destination. Available only on SIP calls, with one REFER in progress at a time; refer lifecycle events are delivered to status_url.

OR
calling.user_eventobjectRequired

Fires a custom JSON event on the call, delivered to the connected client — for example, a Browser SDK client on the call. Use it to trigger client-side behavior; the client-side contract matches the SWML user_event method.

Response

The request has succeeded.
Call Legobject
Returned when the call is a standard PSTN, SIP, or WebRTC call.
OR
Fabric Subscriber Device Legobject

Returned when the call is a Fabric subscriber device leg. The status field is always null for this type.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error