Outbound calls
Hang up an outbound call
Cancels a call that is still ringing, or ends one in progress.
POST https://api.diska.ai/v1/outbound-calls/{outbound_call_id}/hangup
Scope: calls:write
On a call that already ended it does nothing.
Parameters
Path
| Name | Type | Required | Description |
|---|---|---|---|
outbound_call_id | string | Yes | The id returned when you created the call. |
Examples
curl -X POST "https://api.diska.ai/v1/outbound-calls/<outbound_call_id>/hangup" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.post(
"https://api.diska.ai/v1/outbound-calls/<outbound_call_id>/hangup",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 or later, in a .mjs file
const response = await fetch('https://api.diska.ai/v1/outbound-calls/<outbound_call_id>/hangup', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/outbound-calls/<outbound_call_id>/hangup');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Try it
Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need.
POST
https://api.diska.ai/v1/outbound-calls/{outbound_call_id}/hangupStarts with dsk_. It stays in this browser tab only.
path
Enter an API key (dsk_…).
Response 200
| Field | Type | Description |
|---|---|---|
id | string | The call request's ID. |
status | string | queued, ringing, in_progress, ended, failed or cancelled. |
failure_code | string | null | Why it failed, for example destination_no_answer. |
failure_message | string | null | The same reason, in words. |
agent_id | string | The calling agent. |
to | string | Number called. |
from_number | string | DISKA number the person sees. |
contact_name | string | null | Contact name. |
purpose | string | null | Why the company is calling. |
call_id | string | null | The call in GET /v1/calls/{call_id} and in webhooks, once the agent's session starts. |
created_at | string | When the request was made. |
answered_at | string | null | When the person answered. |
ended_at | string | null | When it ended. |
{
"id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"status": "queued",
"failure_code": "…",
"failure_message": "…",
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"to": "…",
"from_number": "…",
"contact_name": "…",
"purpose": "…",
"call_id": "8d0c6a3e-2f14-4b7a-9c55-1e3f0a6d2b81",
"created_at": "2026-10-25T18:40:00Z",
"answered_at": "2026-10-25T18:40:00Z",
"ended_at": "2026-10-25T18:41:35Z"
}
Errors
| Code | When |
|---|---|
404 | Chamada de saída não encontrada. (not found). |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

