Campaigns
Create a campaign
Creates the campaign as a draft (draft).
POST https://api.diska.ai/v1/campaigns
Scope: campaigns:write
The agent must be outbound and published, and phone_number_id an active DISKA line of the organization (see List phone numbers). Windows must sit within contact hours (08:00–20:00). Then add recipients and start it. Send Idempotency-Key to retry the request without creating two.
Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Campaign name. Up to 120 characters. |
agent_id | string | Yes | Published outbound agent that places the calls. |
phone_number_id | string | Yes | DISKA line to call from (from GET /v1/phone-numbers). |
schedule | object | No | When the campaign may dial. |
schedule.start_at | string | null | No | Start (ISO 8601 with time zone), or null to begin when started. |
schedule.timezone | string | No | Time zone of the windows. Default: Africa/Luanda. |
schedule.windows | array | No | Windows per weekday. With no windows, it dials within contact hours. |
schedule.windows[].day | string | Yes | Weekday, in English. One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday. |
schedule.windows[].start | string | Yes | Start, HH:MM. |
schedule.windows[].end | string | Yes | End, HH:MM. |
schedule.max_duration_days | integer | No | Days the campaign may last; at the end, what is left is cancelled. Between 1 and 90. Default: 7. |
limits | object | No | Concurrency, attempts and budget. |
limits.max_concurrency | integer | No | Simultaneous calls of the campaign. Between 1 and 50. Default: 2. |
limits.reserved_capacity | integer | No | Organization concurrent calls kept free for other calls. Between 0 and 50. Default: 1. |
limits.max_attempts | integer | No | Attempts per recipient; only unanswered or busy calls are retried. Between 1 and 3. Default: 1. |
limits.retry_delay_minutes | integer | No | Minutes between attempts. Between 15 and 1440. Default: 60. |
limits.budget_minutes | integer | null | No | Maximum minutes; the campaign pauses before exceeding them. Between 1 and 100000. |
{
"name": "Lembretes de Novembro",
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"phone_number_id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"schedule": {
"timezone": "Africa/Luanda",
"windows": [
{
"day": "monday",
"start": "09:00",
"end": "12:00"
},
{
"day": "monday",
"start": "14:00",
"end": "18:00"
}
]
},
"limits": {
"max_concurrency": 2,
"max_attempts": 2,
"retry_delay_minutes": 60
}
}
Examples
curl -X POST "https://api.diska.ai/v1/campaigns" \
-H "Authorization: Bearer $DISKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Lembretes de Novembro","agent_id":"3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40","phone_number_id":"5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93","schedule":{"timezone":"Africa/Luanda","windows":[{"day":"monday","start":"09:00","end":"12:00"},{"day":"monday","start":"14:00","end":"18:00"}]},"limits":{"max_concurrency":2,"max_attempts":2,"retry_delay_minutes":60}}'
import os
import requests
response = requests.post(
"https://api.diska.ai/v1/campaigns",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
json={
"name": "Lembretes de Novembro",
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"phone_number_id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"schedule": {
"timezone": "Africa/Luanda",
"windows": [{
"day": "monday",
"start": "09:00",
"end": "12:00",
}, {
"day": "monday",
"start": "14:00",
"end": "18:00",
}],
},
"limits": {
"max_concurrency": 2,
"max_attempts": 2,
"retry_delay_minutes": 60,
},
},
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/campaigns', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DISKA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Lembretes de Novembro",
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"phone_number_id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"schedule": {
"timezone": "Africa/Luanda",
"windows": [
{
"day": "monday",
"start": "09:00",
"end": "12:00"
},
{
"day": "monday",
"start": "14:00",
"end": "18:00"
}
]
},
"limits": {
"max_concurrency": 2,
"max_attempts": 2,
"retry_delay_minutes": 60
}
})
})
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/campaigns');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DISKA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Lembretes de Novembro',
'agent_id' => '3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40',
'phone_number_id' => '5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93',
'schedule' => [
'timezone' => 'Africa/Luanda',
'windows' => [[
'day' => 'monday',
'start' => '09:00',
'end' => '12:00',
], [
'day' => 'monday',
'start' => '14:00',
'end' => '18:00',
]],
],
'limits' => [
'max_concurrency' => 2,
'max_attempts' => 2,
'retry_delay_minutes' => 60,
],
]),
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/campaignsStarts with dsk_. It stays in this browser tab only.
Enter an API key (dsk_…).
Response 201
| Field | Type | Description |
|---|---|---|
id | string | Campaign ID. |
name | string | Name. |
status | string | draft, scheduled, running, paused, completed or cancelled. |
agent_id | string | null | Agent. |
agent_name | string | null | Agent name. |
phone_number_id | string | null | Line used. |
phone_number | string | null | Line number. |
schedule | object | Schedule. |
schedule.start_at | string | null | Start (ISO 8601 with time zone), or null to begin when started. |
schedule.timezone | string | Time zone of the windows. Default: Africa/Luanda. |
schedule.windows | array | Windows per weekday. With no windows, it dials within contact hours. |
schedule.windows[].day | string | Weekday, in English. One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday. |
schedule.windows[].start | string | Start, HH:MM. |
schedule.windows[].end | string | End, HH:MM. |
schedule.max_duration_days | integer | Days the campaign may last; at the end, what is left is cancelled. Between 1 and 90. Default: 7. |
limits | object | Limits. |
limits.max_concurrency | integer | Simultaneous calls of the campaign. Between 1 and 50. Default: 2. |
limits.reserved_capacity | integer | Organization concurrent calls kept free for other calls. Between 0 and 50. Default: 1. |
limits.max_attempts | integer | Attempts per recipient; only unanswered or busy calls are retried. Between 1 and 3. Default: 1. |
limits.retry_delay_minutes | integer | Minutes between attempts. Between 15 and 1440. Default: 60. |
limits.budget_minutes | integer | null | Maximum minutes; the campaign pauses before exceeding them. Between 1 and 100000. |
pause_reason | string | null | Why it is paused: manual, budget_exhausted, quota_exhausted or emergency_stop. |
waiting_reason | string | null | Why it is not dialling right now, for example outside_window or no_capacity. One of: outside_window, not_started, no_capacity, capacity_not_configured, line_unavailable, outbound_disabled, agent_unavailable, number_unavailable, halted. |
next_window_at | string | null | When the next window opens. |
deadline_at | string | null | End of the maximum duration. |
created_at | string | null | Creation date (ISO 8601). |
started_at | string | null | When it was started. |
completed_at | string | null | When it finished. |
cancelled_at | string | null | When it was cancelled. |
stats | object | Indicators. |
stats.total | integer | Recipients. Default: 0. |
stats.pending | integer | Left to call. Default: 0. |
stats.in_flight | integer | Dialling or in a call. Default: 0. |
stats.completed | integer | Call placed (answered, not answered or busy). Default: 0. |
stats.failed | integer | Could not be called. Default: 0. |
stats.cancelled | integer | Cancelled. Default: 0. |
stats.excluded | integer | On the do-not-call list. Default: 0. |
stats.calls_started | integer | Attempts sent (each retry counts). Default: 0. |
stats.answered | integer | Answered. Default: 0. |
stats.no_answer | integer | Not answered. Default: 0. |
stats.unavailable | integer | Busy or unavailable. Default: 0. |
stats.answer_rate | number | null | Answered ÷ (answered + not answered + unavailable). |
stats.total_duration_seconds | integer | Total duration of answered calls. Default: 0. |
stats.progress | number | Recipients in a final state ÷ total. Default: 0. |
stats.cost_kz | number | null | Cost in kwanzas, only when a rate is configured. |
stats.with_post_call | integer | Calls with a post-call result. Default: 0. |
{
"id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"name": "Exemplo",
"status": "draft",
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"agent_name": "Recepção",
"phone_number_id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"phone_number": "+244900000000",
"schedule": {
"start_at": "2026-10-25T18:40:00Z",
"timezone": "Africa/Luanda",
"windows": [
{
"day": "monday",
"start": "2026-10-25T18:40:00Z",
"end": "2026-11-01T18:40:00Z"
}
],
"max_duration_days": 7
},
"limits": {
"max_concurrency": 2,
"reserved_capacity": 1,
"max_attempts": 1,
"retry_delay_minutes": 60,
"budget_minutes": 0
},
"pause_reason": "manual",
"waiting_reason": "outside_window",
"next_window_at": "2026-10-25T18:40:00Z",
"deadline_at": "2026-10-25T18:40:00Z",
"created_at": "2026-10-25T18:40:00Z",
"started_at": "2026-10-25T18:40:00Z",
"completed_at": "2026-10-25T18:40:01Z",
"cancelled_at": "2026-10-25T18:40:00Z",
"stats": {
"total": 1,
"pending": 0,
"in_flight": 0,
"completed": 38,
"failed": 3,
"cancelled": 1,
"excluded": 0,
"calls_started": 0,
"answered": 0,
"no_answer": 0,
"unavailable": 0,
"answer_rate": 0,
"total_duration_seconds": 0,
"progress": 0,
"cost_kz": 0,
"with_post_call": 0
}
}
Errors
| Code | When |
|---|---|
403 | Campaigns or API calls are not switched on for the organization. |
404 | The agent or the number does not exist in the organization. |
409 | The agent is not outbound or not published, or the number is not an active DISKA line. |
422 | Windows outside contact hours, an unknown time zone or limits out of range. |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

