Skip to content

Patch an ongoing call by call ID

Request

Interact with an ongoing call by submitting a set of SVAML commands. Use this to force disconnect, play messages, bridge with another call, or perform other call control actions.

Security
BasicAuth or SinchOAuth2
Path
projectIdstring, (uuid)(Project ID)required

The ID of the project.

callIdstring, (ulid)(Call ID)required

The ID of the call.

Headers
Idempotency-Keystring, [ 16 .. 128 ] characters

Client-generated idempotency key to safely retry requests. The server uses this key to recognize retries of the same request. If a request with the same key is received within 10 minutes, the server returns the cached response from the original request. Using a random UUID (v4) is strongly recommended.

Bodyapplication/jsonrequired
commandsArray of objects(SVAML Commands)required

An ordered list of SVAML v2 (Sinch Voice Application Markup Language) commands that describe a call flow. Commands are executed sequentially in the order they are defined.

Blocking vs. non-blocking: Some commands block execution until they complete (pause, webhook, menu, gotoMenu), while others return immediately and run in parallel (dial, messages, amd, answer, hangup, startRecording, stopRecording, bridgeCall, stopMessages). Each command's description specifies its behavior.

Nesting scope: Commands that appear inside event handlers (e.g., dial.events.onAnswer, messages.events.onFinish) form independent sequences and execute in their own context — they are not continuations of the parent sequence.

curl -i -X PATCH \
  -u '<username>:<password>' \
  'https://voice.api.sinch.com/v2/projects/{projectId}/calls/{callId}' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: stringstringstri' \
  -d '{
    "commands": [
      {
        "command": "hangup"
      }
    ]
  }'

Responses

Commands accepted for processing.

Response
No content
We'd love to hear from you!
Rate this content: