Diska
API

Webhooks

Receive the data of every completed call in your system, with requests signed by Diska.

A webhook is a POST request Diska makes to a URL of yours when a call ends, carrying the transcript and the result of post-call processing. Your system receives the data without having to keep asking for it.

There are two ways to receive this data:

Organization webhooksThe agent's Webhook action
Where it is set upThrough the DISKA API, scope webhooks:manageIn the agent (prompt mode): Ações (actions) → Depois da conversa (after the conversation)
CoversEvery completed call in the organizationThat agent's calls
SignatureYes — HMAC-SHA256 with the endpoint's secretNo
RetriesUp to 3 attemptsA single attempt
TestingPOST /v1/webhook-endpoints/{id}/testMake a call

For new integrations, use organization webhooks: they are signed, report their delivery status and are managed through the API.

Each agent can also have its own signed webhooks, including one that receives the call before the agent answers: see Agent webhooks.

Organization webhooks

Register an endpoint

curl -X POST https://api.diska.ai/v1/webhook-endpoints \
  -H "Authorization: Bearer dsk_…" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-system.com/hooks/diska",
    "description": "CRM — production",
    "events": ["call.completed"]
  }'

201 response:

{
  "endpoint": {
    "id": "…",
    "url": "https://your-system.com/hooks/diska",
    "description": "CRM — production",
    "events": ["call.completed"],
    "active": true,
    "disabled_reason": null,
    "failure_count": 0,
    "last_delivery_at": null,
    "last_delivery_status": null,
    "secret_preview": "dskw_AbC…wXyZ",
    "created_at": "…"
  },
  "secret": "dskw_…"
}

The secret (starts with dskw_) is used to verify the signature and is only shown in this response. Store it with your receiver's configuration. If you lose it, delete the endpoint and register it again.

URL and event rules:

  • The URL must be a full https:// address with a domain (12 to 2000 characters). Private or internal addresses are refused.
  • events is optional; it defaults to ["call.completed"]. It must contain at least one event.
  • Each organization can have up to 10 endpoints.

Events

EventWhen it is sent
call.completedA call ends with status completed and post-call processing (extractions, evaluations, post-call SMS and actions) finishes. Calls that failed, were cancelled or were abandoned do not produce this event.
booking.createdAccepted as a subscription, but the platform does not send this event yet. Do not rely on it.
pingOnly sent when you call the test endpoint. Cannot be subscribed to.

call.completed is also sent for answered outbound calls and campaign calls, and for chat conversations when they end (channel web_chat).

call.completed payload

The body is JSON (UTF-8). Example:

{
  "event": "call.completed",
  "call_id": "8d0c6a3e-…",
  "session_id": "…",
  "organization_id": "…",
  "agent_id": "…",
  "ended_at": "2026-10-23T14:05:12.345678+00:00",
  "caller_contact": "+244923000000",
  "extracted_data": { "nome": "Ana Silva" },
  "evaluations": [],
  "sentiment": "positive",
  "post_call_sms": [],
  "custom_actions": [],
  "executed_actions": [],
  "transcript": [
    { "role": "assistant", "content": "Bom dia, fala com a assistente da …" },
    { "role": "user", "content": "Bom dia, queria marcar uma consulta." }
  ]
}
FieldDescription
call_idThe call's identifier. Use it with GET /v1/calls/{call_id} to get the full detail.
session_idThe voice session's identifier (shown as external_ref in DISKA API calls).
agent_id, organization_idThe agent that handled the call, and the organization.
ended_atEnd date and time (ISO 8601).
caller_contactThe caller's contact, when known.
extracted_dataValues from the agent's information extractors.
evaluationsResults of the custom evaluations.
sentimentpositive, neutral, negative, or null when it could not be classified.
post_call_smsResult of the post-call SMS.
custom_actionsResult of the custom actions that run after the call.
executed_actionsActions executed during and after the call.
transcriptThe conversation transcript, turn by turn.

On an agent with Redact personal data on, transcript, extracted_data, evaluations, post_call_sms, custom_actions and executed_actions arrive with tags such as [NOME] and [TELEFONE] instead of the personal data. caller_contact keeps the call's number.

The payload may gain new fields; your receiver should ignore the ones it does not know. If a call has no stored post-call result, the event carries only event, call_id, session_id, organization_id, agent_id, ended_at, caller_contact and an empty transcript.

Headers

Content-Type:       application/json
User-Agent:         Diska-Webhooks/1.0
X-Diska-Event:      call.completed
X-Diska-Delivery:   <unique delivery identifier>
X-Diska-Timestamp:  <unix seconds>
X-Diska-Signature:  sha256=<hex>

X-Diska-Delivery stays the same across retries of the same delivery: use it to avoid processing the same event twice.

Verify the signature

The signature is the hex HMAC-SHA256 of the text {X-Diska-Timestamp}.{body} using the endpoint's secret. Compute it over the raw body, exactly as received — not over JSON you parsed and serialized again.

import hashlib
import hmac
import time


def is_valid(secret: str, timestamp: str, body: bytes, signature: str) -> bool:
    if abs(time.time() - int(timestamp)) > 300:  # reject requests older than 5 minutes
        return False
    expected = hmac.new(
        secret.encode(), f"{timestamp}.".encode() + body, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(f"sha256={expected}", signature)

The 5-minute window is a recommendation, to stop an old request from being replayed by a third party.

Responding and retries

  • Respond with a 2xx code within 10 seconds. Ideally, put the event on a queue and process it later.
  • Any other response counts as a failure. Redirects (3xx) are not followed and also count as failures.
  • A failed delivery is retried up to 3 attempts in total, a few seconds apart. 4xx responses (except 408 and 429) are not retried. For some calls Diska makes a single attempt.
  • After that there is no re-sending. Delivery is best-effort: for reconciliation, GET /v1/calls is the source of truth.

Automatic deactivation

After 20 consecutive failed deliveries, the endpoint is deactivated: active becomes false and disabled_reason explains why. A successful delivery resets the counter to zero.

Once your receiver is fixed, reactivate the endpoint:

curl -X PATCH https://api.diska.ai/v1/webhook-endpoints/<endpoint_id> \
  -H "Authorization: Bearer dsk_…" \
  -H "Content-Type: application/json" \
  -d '{ "active": true }'

Reactivating resets failure_count to zero and clears disabled_reason. To pause deliveries, send { "active": false }.

Test your receiver

curl -X POST https://api.diska.ai/v1/webhook-endpoints/<endpoint_id>/test \
  -H "Authorization: Bearer dsk_…"

Diska sends a signed ping event to your URL, with the same headers and retry rules:

{ "event": "ping", "organization_id": "…", "endpoint_id": "…" }

The response tells you how it went: status (delivered, failed or blocked), attempts, http_status and, on failure, error. The test works even when the endpoint is deactivated, and a failed test does not count towards automatic deactivation.

Monitor deliveries

GET /v1/webhook-endpoints shows, for each endpoint, last_delivery_at, last_delivery_status (for example delivered (200) or failed (HTTP 500)) and failure_count. The full reference of the management endpoints is in Endpoints.

The agent's Webhook action

In a prompt-mode agent you can send the data of each of that agent's calls to a URL, without using the DISKA API:

  1. Open the agent and click Ações (actions).
  2. Under Depois da conversa (after the conversation), click Adicionar (add) and choose Webhook ("Enviar os dados da chamada para um URL." — send the call data to a URL).
  3. Enter the URL. It must use HTTPS and have a valid domain.
  4. Publish the agent: published calls use the actions of the published version.

When post-call processing of each of that agent's calls finishes, Diska makes a JSON POST to that URL with the same content as the call.completed event, except call_id (use session_id, which matches external_ref in DISKA API calls). Differences from organization webhooks:

  • The request is not signed and carries no X-Diska-… headers. Use a hard-to-guess URL and treat the content as unverified.
  • A single attempt is made, with a 20-second limit; there are no retries and no automatic deactivation.
  • It does not depend on the call's final status: it can also be sent for calls that failed or were cancelled (not for abandoned ones).
  • If the agent has several Webhook actions, only the first one with a valid URL is used.

The agent's webhooks: Inbound and Data

In the Telefone (phone) tab of each agent's Definições de publicação (publish settings) you can set two webhooks for that agent, signed with the agent's secret:

  • Inbound Webhook: receives each inbound call before the agent speaks. Its answer can give the agent facts about the caller (name, plan, balance…).
  • Data Webhook: receives the data of each of the agent's completed calls — the same content as call.completed, plus the call and metadata fields.

See Agent webhooks.

Copyright © 2026