Diska
Chat

Send a message

Sends the person's message and returns the agent's reply (reply) in the same request, usually within a few seconds.
POST https://api.diska.ai/v1/chats/{chat_id}/messages

Scope: chats:write

One message at a time per chat. If the agent concludes the chat, chat.status becomes ended. The agent's actions (for example, booking a meeting) run for real and ask for confirmation as on calls.

Parameters

Path

NameTypeRequiredDescription
chat_idstringYesThe chat's ID.

Request body

application/json

FieldTypeRequiredDescription
messagestringYesThe person's message. Up to 4000 characters.
{
  "message": "Queria marcar uma consulta para sexta-feira."
}

Examples

curl -X POST "https://api.diska.ai/v1/chats/<chat_id>/messages" \
  -H "Authorization: Bearer $DISKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Queria marcar uma consulta para sexta-feira."}'

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}/messages
Starts with dsk_. It stays in this browser tab only.
path
Enter an API key (dsk_…).

Response 200

FieldTypeDescription
chatobjectThe chat, with its updated state.
chat.idstringChat ID (the same as GET /v1/calls/{call_id}).
chat.agent_idstringThe agent.
chat.statusstringactive or ended.
chat.contactstring | nullWho is chatting, as you stated it.
chat.metadataobjectYour metadata, returned as sent.
chat.created_atstringCreation date (ISO 8601).
chat.ended_atstring | nullWhen it ended.
chat.end_reasonstring | nullended_by_api, agent_ended or inactivity.
replystring | nullThe agent's reply, or null.
messagesarrayThe new messages: the person's and the agent's.
messages[].idstringMessage ID.
messages[].rolestringuser (the person) or assistant (the agent).
messages[].contentstringThe text.
messages[].created_atstring | nullWhen it was written.
{
  "chat": {
    "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"
  },
  "reply": "…",
  "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 chat ended, or the previous message is still being answered.
502The agent could not answer in time. The message was not stored: send it again.

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

Copyright © 2026