Endpoints
Every endpoint below belongs to the DISKA API, at https://api.diska.ai/v1, and requires an API key in the Authorization: Bearer dsk_… header (or X-API-Key). Errors shared by all of them — 401, 403, format 422, 429, 5xx — are described under Errors; this page lists only the errors specific to each endpoint.
Summary
| Method | Path | Scope |
|---|---|---|
| GET | /v1/me | — |
| GET | /v1/agents | agents:read |
| GET | /v1/agents/{agent_id} | agents:read |
| POST | /v1/agents | agents:write |
| POST | /v1/agents/{agent_id}/publish | agents:write |
| GET | /v1/calls | calls:read |
| GET | /v1/calls/{call_id} | calls:read |
| GET | /v1/analytics/overview | analytics:read |
| GET | /v1/phone-numbers | phone-numbers:read |
| GET | /v1/knowledge-bases | knowledge:read |
| POST | /v1/knowledge-bases | knowledge:write |
| POST | /v1/knowledge-bases/{knowledge_base_id}/documents | knowledge:write |
| POST | /v1/knowledge-bases/{knowledge_base_id}/documents/url | knowledge:write |
| POST | /v1/knowledge-bases/{knowledge_base_id}/documents/pdf | knowledge:write |
| GET | /v1/webhook-endpoints | webhooks:manage |
| POST | /v1/webhook-endpoints | webhooks:manage |
| PATCH | /v1/webhook-endpoints/{endpoint_id} | webhooks:manage |
| DELETE | /v1/webhook-endpoints/{endpoint_id} | webhooks:manage |
| POST | /v1/webhook-endpoints/{endpoint_id}/test | webhooks:manage |
| GET | /v1/openapi.json | No authentication |
Identity
GET /v1/me
Returns the organization and key behind the token. Needs no scope — use it to check that the key works.
200 response: organization (id, name, slug) and key (id, name, key_preview, scopes, expires_at, created_at, last_used_at). scopes: [] means full access. Example in DISKA API.
Agents
The agent object
| Field | Description |
|---|---|
id | The agent's identifier. |
name, slug, description | Name, readable identifier and description (may be null). |
status | draft, active, inactive or archived. A published agent is active. |
agent_type | inbound, outbound, voice_widget or chat. |
editing_mode | prompt or flow (Flow Builder). Cannot change after creation. |
version | The agent's version number. |
phone_number | The number assigned to the agent, or null. |
public_channel_enabled | true when the agent's public link is active. |
created_at, updated_at | Creation and last-change dates. |
The agent's internal configuration (prompt, flows, voice, actions) is not exposed.
GET /v1/agents
Lists the organization's agents, most recently changed first.
| Parameter | Description |
|---|---|
agent_type | inbound, outbound, voice_widget or chat. |
status | draft, active, inactive or archived. Without this filter, archived agents are left out. |
search | Text contained in the name (up to 200 characters). |
200 response: { "items": [ <agent>, … ] }.
GET /v1/agents/{agent_id}
Returns one agent. 404 with Agente não encontrado. ("agent not found") if it does not exist in the organization.
POST /v1/agents
Creates an agent. The agent starts as a draft (status: draft); publish it to make it available on the channels.
| Field | Required | Description |
|---|---|---|
name | No | Up to 120 characters. Default: Novo agente, or the template's name. |
agent_type | No | inbound, outbound, voice_widget or chat. Default: inbound, or the template's type. |
editing_mode | No | prompt or flow. Default: prompt for a blank agent, flow from a template. |
template_id | No | Identifier of a Diska agent template (up to 64 characters). Without it, a blank agent is created. The DISKA API does not list templates. |
curl -X POST https://api.diska.ai/v1/agents \
-H "Authorization: Bearer dsk_…" \
-H "Content-Type: application/json" \
-d '{ "name": "Reception", "agent_type": "inbound", "editing_mode": "prompt" }'
201 response: the created agent. Errors: 404 with Modelo não encontrado. ("template not found") when the template_id does not exist; 422 if the template cannot be installed.
POST /v1/agents/{agent_id}/publish
Publishes the agent's draft as a new version and makes the agent active. For flow agents it also publishes the main flow and the subflows it uses. If nothing changed since the last publish, no new version is created.
Optional body:
| Field | Description |
|---|---|
label | Version name, up to 120 characters. Default: Versão N. |
curl -X POST https://api.diska.ai/v1/agents/<agent_id>/publish \
-H "Authorization: Bearer dsk_…" \
-H "Content-Type: application/json" \
-d '{ "label": "December opening hours" }'
200 response: the updated agent. Errors:
| Code | When |
|---|---|
404 | Agente não encontrado. |
409 | O agente está arquivado. Restaure-o antes de publicar. (the agent is archived; restore it before publishing) |
422 | The agent cannot be published — for example O agente precisa de instruções (prompt) antes de ser publicado. (the agent needs a prompt) or a flow validation error. |
Calls
GET /v1/calls
Lists the organization's calls, newest first. See pagination.
| Parameter | Description |
|---|---|
agent_id | Only calls handled by this agent. |
status | created, active, completed, failed, cancelled or abandoned. |
channel | browser_demo (web call), phone, whatsapp or web_chat. |
search | Text in the identifier, external_ref, or the caller's name or contact (up to 200 characters). Not available with cursor. |
limit | 1–200, default 50. |
offset | Offset mode: how many calls to skip (default 0). |
cursor | Cursor mode: start for the first page, then the next_cursor you received. |
200 response:
{
"items": [ { "id": "…", "agent_name": "Reception", "channel": "phone", "status": "completed", "…": "…" } ],
"limit": 50,
"total": 1234,
"offset": 0,
"next_cursor": null
}
In offset mode, total and offset are filled in and next_cursor is null. In cursor mode, total and offset are null and next_cursor points to the next page (or is null at the end).
Each call in the list has:
| Field | Description |
|---|---|
id | The call's identifier (the call_id in webhooks). |
external_ref | The voice session's identifier (the session_id in webhooks). |
agent_id, agent_name | The agent that handled the call. |
channel | browser_demo, phone, whatsapp or web_chat. |
direction | inbound, outbound, or null for web calls. |
status | created, active, completed, failed, cancelled or abandoned. |
caller_name, caller_contact | The caller's name and contact, when known. |
started_at, ended_at, duration_seconds | Start, end and duration in seconds. |
end_reason | Why the call ended. |
summary | Call summary, when generated. |
is_simulation | true when channel is browser_demo. |
labels | The call's labels. |
has_post_call | true when a post-call result exists. |
executed_actions_count | Number of executed actions. |
GET /v1/calls/{call_id}
Returns one call with every list field plus:
| Field | Description |
|---|---|
organization_id | The call's organization. |
messages | Transcript: a list of { id, sequence, role, content, created_at }, in order. |
tool_calls | Executed actions: { id, tool_name, status, input, output, error_message, latency_ms, called_at, completed_at }. |
post_call | Post-call result (the content of the call.completed webhook, without call_id), or null. |
has_recording | true when a recording is available. |
recording_state | disabled, available, failed, expired or deleted. |
metadata | The call's technical metadata. Its content is not stable — do not rely on it. |
The recording audio is not returned by the DISKA API. 404 with Chamada não encontrada. ("call not found") if the call does not exist in the organization.
Analytics
GET /v1/analytics/overview
The same summary as the backoffice's Análises (analytics) page, for a window that ends at the time of the request, compared with the previous window of the same size.
| Parameter | Description |
|---|---|
period | daily (last 24 hours), weekly (last 7 days, default) or monthly (last 30 days). |
agent_id | Only this agent. |
agent_type | all (default), inbound or outbound. |
200 response:
| Field | Description |
|---|---|
period, start, end | The analysed window. |
totals | calls, minutes and avg_duration_seconds, each with value, previous and change_pct (null when the previous window has no data). |
daily | Per day (UTC): date, calls, minutes, completed, failed, cancelled. |
by_status, by_end_reason | Breakdown: key, label, count, pct. |
sentiment | Share of positive calls (positive_pct), classified, total, breakdown and daily trend. |
agents | Per-agent performance: calls, minutes, completions and changes. |
actions | Usage of each executed action, with a daily trend. |
failed_calls | Recent failed calls: id, started_at, contact, agent_name, end_reason. |
Numbers
GET /v1/phone-numbers
The organization's phone number inventory.
| Parameter | Description |
|---|---|
search | Text in the number, the name or the SIP domain (up to 200 characters). |
number_type | purchased (DISKA numbers) or imported (your own numbers over SIP). |
200 response: { "items": [ … ], "total": N }. Each number includes id, e164, friendly_name, number_type, status (active or inactive), country_code, capabilities (calls, sms), agent_id and agents (agents using the number: id, name, status). Numbers imported over SIP also carry the trunk fields (sip_domain, sip_username, sip_transport, sip_status…); the SIP password is never returned, only sip_password_configured.
Knowledge
The knowledge base object
id, organization_id, name, instruction (when the agent should use this base), description, document_count, assigned_agent_count, created_at, updated_at.
The document object
id, organization_id, knowledge_base_id, name, source_type (manual, pdf or url), status, extraction_status, indexing_status (indexed once indexing has finished), content_text, original_url, mime_type, size_bytes, error_message, has_file, created_at, updated_at, among others.
GET /v1/knowledge-bases
Lists the knowledge bases. Optional search parameter: text contained in the name or the instruction. 200 response: { "items": [ <base>, … ] }.
POST /v1/knowledge-bases
| Field | Required | Description |
|---|---|---|
name | Yes | 1 to 200 characters. |
instruction | Yes | When and how the agent should use this base. 1 to 4000 characters. |
description | No | Up to 2000 characters. |
201 response: the created base. For an agent to use the base, assign it in the backoffice.
POST /v1/knowledge-bases/{knowledge_base_id}/documents
Adds a text document. Indexing starts right away.
| Field | Required | Description |
|---|---|---|
name | Yes | 1 to 200 characters. |
content | Yes | The text, up to 200,000 characters. |
curl -X POST https://api.diska.ai/v1/knowledge-bases/<knowledge_base_id>/documents \
-H "Authorization: Bearer dsk_…" \
-H "Content-Type: application/json" \
-d '{ "name": "Opening hours", "content": "We are open Monday to Friday, 8am to 5pm." }'
POST /v1/knowledge-bases/{knowledge_base_id}/documents/url
Imports the text of a public web page.
| Field | Required | Description |
|---|---|---|
name | Yes | 1 to 200 characters. |
url | Yes | A full http:// or https:// address, up to 2000 characters. |
The page must respond within 15 seconds, be at most 2 MB and be HTML, text or JSON. Private or internal addresses are refused, and at most 3 redirects are followed.
POST /v1/knowledge-bases/{knowledge_base_id}/documents/pdf
Uploads a PDF as multipart/form-data, in the file field (up to 25 MB).
curl -X POST https://api.diska.ai/v1/knowledge-bases/<knowledge_base_id>/documents/pdf \
-H "Authorization: Bearer dsk_…" \
-F "file=@price-list.pdf;type=application/pdf"
Document responses and errors
The three document endpoints respond 201 with the created document. Specific errors:
| Code | When |
|---|---|
400 | Content refused — for example Ficheiro vazio. (empty file), PDF demasiado grande (máx. 25 MB). (PDF too large), Apenas ficheiros PDF são aceites. (only PDFs accepted), O ficheiro não parece ser um PDF válido. (not a valid PDF), Tempo esgotado ao obter a página. (timed out fetching the page), A página não devolveu texto legível. (no readable text) or a URL blocked for security. |
404 | Base de conhecimento não encontrada. ("knowledge base not found") |
Webhooks
How deliveries, events and signatures work: see Webhooks.
The endpoint object
| Field | Description |
|---|---|
id | The endpoint's identifier. |
url, description | Destination and description. |
events | Subscribed events. |
active | false when it was deactivated (by you or automatically). |
disabled_reason | Why it was automatically deactivated, or null. |
failure_count | Consecutive failed deliveries. |
last_delivery_at, last_delivery_status | Last delivery and its result. |
secret_preview | Start and end of the secret, to identify it. |
created_at | Creation date. |
GET /v1/webhook-endpoints
Lists the organization's endpoints (active and inactive), newest first. 200 response: a list of endpoints.
POST /v1/webhook-endpoints
| Field | Required | Description |
|---|---|---|
url | Yes | Full https:// URL, 12 to 2000 characters. |
description | No | Up to 500 characters. |
events | No | List of events (call.completed, booking.created). Default ["call.completed"]. |
201 response: { "endpoint": <endpoint>, "secret": "dskw_…" }. The secret appears only in this response. 400 errors: URL inválido: use um endpoint https:// completo. (invalid URL), URL bloqueado por segurança: … (URL blocked for security), Subscreva pelo menos um evento. (subscribe to at least one event), Eventos desconhecidos: … (unknown events), Limite de 10 endpoints por organização atingido. (10-endpoint limit reached).
PATCH /v1/webhook-endpoints/{endpoint_id}
Changes only the fields you send:
| Field | Description |
|---|---|
url | New https:// URL. |
description | New description; "" clears it. |
events | New list of events (at least one). |
active | true reactivates the endpoint and resets failure_count; false pauses deliveries. |
200 response: the updated endpoint. Errors: 404 with Endpoint não encontrado. ("endpoint not found"); 400 with the same messages as creation. The secret does not change.
DELETE /v1/webhook-endpoints/{endpoint_id}
Deletes the endpoint. 200 response: the deleted endpoint. 404 with Endpoint não encontrado.
POST /v1/webhook-endpoints/{endpoint_id}/test
Sends a signed ping event to the endpoint's URL, even if it is deactivated. 200 response:
{ "status": "delivered", "attempts": 1, "http_status": 200 }
status can be delivered, failed (with error) or blocked (the URL now points to an address that is not allowed). 404 with Endpoint não encontrado.
The backoffice's internal API
The backoffice uses other endpoints, at https://api.diska.ai/api/v1, authenticated with the signed-in person's session. They are not part of the DISKA API: they do not accept API keys, are not documented and can change without notice. If you need something only the backoffice does, talk to us.

