Diska
Chat

End a chat

Ends the chat.
POST https://api.diska.ai/v1/chats/{chat_id}/end

Scope: chats:write

The same processing as a completed call then runs — extractions, evaluations and summary — and the call.completed webhook is sent. A chat with no messages for 30 minutes ends by itself, the same way. Ending a chat that already ended does nothing.

Parameters

Path

NameTypeRequiredDescription
chat_idstringYesThe chat's ID.

Examples

curl -X POST "https://api.diska.ai/v1/chats/<chat_id>/end" \
  -H "Authorization: Bearer $DISKA_API_KEY"

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.

POSThttps://api.diska.ai/v1/chats/{chat_id}/end
Starts with dsk_. It stays in this browser tab only.
path
Enter an API key (dsk_…).

Response 200

FieldTypeDescription
idstringChat ID (the same as GET /v1/calls/{call_id}).
agent_idstringThe agent.
statusstringactive or ended.
contactstring | nullWho is chatting, as you stated it.
metadataobjectYour metadata, returned as sent.
created_atstringCreation date (ISO 8601).
ended_atstring | nullWhen it ended.
end_reasonstring | nullended_by_api, agent_ended or inactivity.
messagesarrayThe messages, in order.
messages[].idstringMessage ID.
messages[].rolestringuser (the person) or assistant (the agent).
messages[].contentstringThe text.
messages[].created_atstring | nullWhen it was written.
{
  "id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
  "agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
  "status": "active",
  "contact": "+244900000000",
  "metadata": {},
  "created_at": "2026-10-25T18:40:00Z",
  "ended_at": "2026-10-25T18:41:35Z",
  "end_reason": "caller_hangup",
  "messages": [
    {
      "id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
      "role": "user",
      "content": "Bom dia, queria marcar uma consulta.",
      "created_at": "2026-10-25T18:40:00Z"
    }
  ]
}

Errors

CodeWhen
403API chat is not switched on for the organization.
404Chat não encontrado. (chat not found).
409The previous message is still being answered.

Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

Copyright © 2026