Outbound calls
Make an outbound call
The agent calls the person now, from the agent's DISKA number.
POST https://api.diska.ai/v1/outbound-calls
Scope: calls:write
The response carries the request's id, in state queued. Follow it with Get an outbound call: once the agent's session starts, the call_id appears — the same as in GET /v1/calls and in webhooks. The agent receives the call context from the platform: it is an outbound call, the reason (purpose) and the contact's name. Send Idempotency-Key to retry the request without calling twice.
Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | The agent that calls (outbound, published, prompt mode). Up to 64 characters. |
to | string | Yes | Angolan mobile: +244 9XX XXX XXX, 9XX XXX XXX or 00244…. 9 to 20 characters. |
contact_name | string | null | No | The person's name, so the agent can address them. Up to 120 characters. |
purpose | string | null | No | Why the company is calling, as the agent may say it. Never read as an instruction. Up to 120 characters. |
variables | object | No | Call variables ({{name}} in flows and actions). Up to 20; reserved keys or values carrying instructions are refused. |
{
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"to": "+244923000000",
"contact_name": "Ana Silva",
"purpose": "Lembrete da consulta de sexta-feira",
"variables": {
"consulta": "sexta, 10h"
}
}
Examples
curl -X POST "https://api.diska.ai/v1/outbound-calls" \
-H "Authorization: Bearer $DISKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_id":"3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40","to":"+244923000000","contact_name":"Ana Silva","purpose":"Lembrete da consulta de sexta-feira","variables":{"consulta":"sexta, 10h"}}'
import os
import requests
response = requests.post(
"https://api.diska.ai/v1/outbound-calls",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
json={
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"to": "+244923000000",
"contact_name": "Ana Silva",
"purpose": "Lembrete da consulta de sexta-feira",
"variables": {
"consulta": "sexta, 10h",
},
},
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', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DISKA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"to": "+244923000000",
"contact_name": "Ana Silva",
"purpose": "Lembrete da consulta de sexta-feira",
"variables": {
"consulta": "sexta, 10h"
}
})
})
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');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DISKA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40',
'to' => '+244923000000',
'contact_name' => 'Ana Silva',
'purpose' => 'Lembrete da consulta de sexta-feira',
'variables' => [
'consulta' => 'sexta, 10h',
],
]),
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-callsStarts with dsk_. It stays in this browser tab only.
Enter an API key (dsk_…).
Response 201
| 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 |
|---|---|
403 | API calls are not switched on for the organization, or the organization is not enabled for outbound calls. |
404 | Agente não encontrado. (agent not found). |
409 | The agent is not outbound, not published or not in prompt mode; it has no active DISKA number; outside contact hours; or the number is on the do-not-call list. |
422 | The destination is not an Angolan mobile, is the agent's own number, or some variables were refused. |
429 | The organization's concurrent call limit, or this hour's API call limit. |
503 | The phone line is not available right now. |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

