Call control
Answer, hang up, and disconnect active call sessions. These commands are sent to the session command endpoint and do not have their own rate-limit group.
Common response format
Section titled “Common response format”All session commands return 202 Accepted with a deferred operation envelope:
{ "operation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "in_progress", "timeout_ms": 2000}The final result is delivered asynchronously via a command.result webhook.
Common request fields
Section titled “Common request fields”| Field | Type | Required | Description |
|---|---|---|---|
command_uid | string | optional | Caller-supplied idempotency key. Auto-generated UUID if omitted. Max 128 chars, ^[a-zA-Z0-9._-]+$. |
Answer
Section titled “Answer”Answer an incoming call. The result arrives asynchronously via webhook after the underlying execute completes (deferred response, 2 s timeout).
/api/v1/sessions/{uuid}/commands/answer curl -X POST https://gateway.example.com/api/v1/sessions/{uuid}/commands/answer \
-H "X-App-ID: YOUR_APP_ID" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' Request body — no additional fields beyond the optional command_uid.
Triggered webhooks
call.answered— fired on execute-complete confirmation.command.result— deferred; fires on execute complete or after the 2 s timeout.
Hangup
Section titled “Hangup”Hang up a call with an optional Q.850 cause code. The command.result webhook fires immediately (fire-and-forget). A separate call.hangup lifecycle webhook fires later, when the channel is fully torn down.
/api/v1/sessions/{uuid}/commands/hangup curl -X POST https://gateway.example.com/api/v1/sessions/{uuid}/commands/hangup \
-H "X-App-ID: YOUR_APP_ID" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cause": "USER_BUSY"}' Request body
| Field | Type | Required | Description |
|---|---|---|---|
cause | string | optional | Q.850 hangup cause code. Defaults to NORMAL_CLEARING. Max 64 chars, ^[A-Z_]+$. |
Triggered webhooks
command.result— immediate; fires right after command dispatch.call.hangup— deferred lifecycle event; fires when channel teardown completes.
Disconnect
Section titled “Disconnect”Disconnect the session and return control to the dialplan. Typically results in the call being hung up shortly after. The command.result webhook fires immediately.
/api/v1/sessions/{uuid}/commands/disconnect curl -X POST https://gateway.example.com/api/v1/sessions/{uuid}/commands/disconnect \
-H "X-App-ID: YOUR_APP_ID" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' Request body — no additional fields beyond the optional command_uid.
Triggered webhooks
command.result— immediate; fires right after command dispatch.