Diska
API

Endpoints

Reference for every DISKA API endpoint — parameters, bodies, responses and errors.
Every endpoint also has its own page in the API reference, with the full schema, examples in cURL, Python, JavaScript and PHP, and Try it.

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

MethodPathScope
GET/v1/me—
GET/v1/agentsagents:read
GET/v1/agents/{agent_id}agents:read
POST/v1/agentsagents:write
POST/v1/agents/{agent_id}/publishagents:write
GET/v1/callscalls:read
GET/v1/calls/{call_id}calls:read
GET/v1/analytics/overviewanalytics:read
GET/v1/phone-numbersphone-numbers:read
GET/v1/knowledge-basesknowledge:read
POST/v1/knowledge-basesknowledge:write
POST/v1/knowledge-bases/{knowledge_base_id}/documentsknowledge:write
POST/v1/knowledge-bases/{knowledge_base_id}/documents/urlknowledge:write
POST/v1/knowledge-bases/{knowledge_base_id}/documents/pdfknowledge:write
GET/v1/webhook-endpointswebhooks:manage
POST/v1/webhook-endpointswebhooks:manage
PATCH/v1/webhook-endpoints/{endpoint_id}webhooks:manage
DELETE/v1/webhook-endpoints/{endpoint_id}webhooks:manage
POST/v1/webhook-endpoints/{endpoint_id}/testwebhooks:manage
GET/v1/openapi.jsonNo 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

FieldDescription
idThe agent's identifier.
name, slug, descriptionName, readable identifier and description (may be null).
statusdraft, active, inactive or archived. A published agent is active.
agent_typeinbound, outbound, voice_widget or chat.
editing_modeprompt or flow (Flow Builder). Cannot change after creation.
versionThe agent's version number.
phone_numberThe number assigned to the agent, or null.
public_channel_enabledtrue when the agent's public link is active.
created_at, updated_atCreation 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.

ParameterDescription
agent_typeinbound, outbound, voice_widget or chat.
statusdraft, active, inactive or archived. Without this filter, archived agents are left out.
searchText 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.

FieldRequiredDescription
nameNoUp to 120 characters. Default: Novo agente, or the template's name.
agent_typeNoinbound, outbound, voice_widget or chat. Default: inbound, or the template's type.
editing_modeNoprompt or flow. Default: prompt for a blank agent, flow from a template.
template_idNoIdentifier 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:

FieldDescription
labelVersion 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:

CodeWhen
404Agente não encontrado.
409O agente está arquivado. Restaure-o antes de publicar. (the agent is archived; restore it before publishing)
422The 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.

ParameterDescription
agent_idOnly calls handled by this agent.
statuscreated, active, completed, failed, cancelled or abandoned.
channelbrowser_demo (web call), phone, whatsapp or web_chat.
searchText in the identifier, external_ref, or the caller's name or contact (up to 200 characters). Not available with cursor.
limit1–200, default 50.
offsetOffset mode: how many calls to skip (default 0).
cursorCursor 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:

FieldDescription
idThe call's identifier (the call_id in webhooks).
external_refThe voice session's identifier (the session_id in webhooks).
agent_id, agent_nameThe agent that handled the call.
channelbrowser_demo, phone, whatsapp or web_chat.
directioninbound, outbound, or null for web calls.
statuscreated, active, completed, failed, cancelled or abandoned.
caller_name, caller_contactThe caller's name and contact, when known.
started_at, ended_at, duration_secondsStart, end and duration in seconds.
end_reasonWhy the call ended.
summaryCall summary, when generated.
is_simulationtrue when channel is browser_demo.
labelsThe call's labels.
has_post_calltrue when a post-call result exists.
executed_actions_countNumber of executed actions.

GET /v1/calls/{call_id}

Returns one call with every list field plus:

FieldDescription
organization_idThe call's organization.
messagesTranscript: a list of { id, sequence, role, content, created_at }, in order.
tool_callsExecuted actions: { id, tool_name, status, input, output, error_message, latency_ms, called_at, completed_at }.
post_callPost-call result (the content of the call.completed webhook, without call_id), or null.
has_recordingtrue when a recording is available.
recording_statedisabled, available, failed, expired or deleted.
metadataThe 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.

ParameterDescription
perioddaily (last 24 hours), weekly (last 7 days, default) or monthly (last 30 days).
agent_idOnly this agent.
agent_typeall (default), inbound or outbound.

200 response:

FieldDescription
period, start, endThe analysed window.
totalscalls, minutes and avg_duration_seconds, each with value, previous and change_pct (null when the previous window has no data).
dailyPer day (UTC): date, calls, minutes, completed, failed, cancelled.
by_status, by_end_reasonBreakdown: key, label, count, pct.
sentimentShare of positive calls (positive_pct), classified, total, breakdown and daily trend.
agentsPer-agent performance: calls, minutes, completions and changes.
actionsUsage of each executed action, with a daily trend.
failed_callsRecent failed calls: id, started_at, contact, agent_name, end_reason.

Numbers

GET /v1/phone-numbers

The organization's phone number inventory.

ParameterDescription
searchText in the number, the name or the SIP domain (up to 200 characters).
number_typepurchased (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

FieldRequiredDescription
nameYes1 to 200 characters.
instructionYesWhen and how the agent should use this base. 1 to 4000 characters.
descriptionNoUp 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.

FieldRequiredDescription
nameYes1 to 200 characters.
contentYesThe 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.

FieldRequiredDescription
nameYes1 to 200 characters.
urlYesA 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:

CodeWhen
400Content 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.
404Base de conhecimento não encontrada. ("knowledge base not found")

Webhooks

How deliveries, events and signatures work: see Webhooks.

The endpoint object

FieldDescription
idThe endpoint's identifier.
url, descriptionDestination and description.
eventsSubscribed events.
activefalse when it was deactivated (by you or automatically).
disabled_reasonWhy it was automatically deactivated, or null.
failure_countConsecutive failed deliveries.
last_delivery_at, last_delivery_statusLast delivery and its result.
secret_previewStart and end of the secret, to identify it.
created_atCreation 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

FieldRequiredDescription
urlYesFull https:// URL, 12 to 2000 characters.
descriptionNoUp to 500 characters.
eventsNoList 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:

FieldDescription
urlNew https:// URL.
descriptionNew description; "" clears it.
eventsNew list of events (at least one).
activetrue 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.

Copyright © 2026