Chat
Get a chat
The chat with every message, in order.
GET https://api.diska.ai/v1/chats/{chat_id}
Scope: chats:write
Parameters
Path
| Name | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | The chat's ID. |
Examples
curl "https://api.diska.ai/v1/chats/<chat_id>" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/chats/<chat_id>",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 or later, in a .mjs file
const response = await fetch('https://api.diska.ai/v1/chats/<chat_id>', {
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/chats/<chat_id>');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
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.
GET
https://api.diska.ai/v1/chats/{chat_id}Starts with dsk_. It stays in this browser tab only.
path
Enter an API key (dsk_…).
Response 200
| Field | Type | Description |
|---|---|---|
id | string | Chat ID (the same as GET /v1/calls/{call_id}). |
agent_id | string | The agent. |
status | string | active or ended. |
contact | string | null | Who is chatting, as you stated it. |
metadata | object | Your metadata, returned as sent. |
created_at | string | Creation date (ISO 8601). |
ended_at | string | null | When it ended. |
end_reason | string | null | ended_by_api, agent_ended or inactivity. |
messages | array | The messages, in order. |
messages[].id | string | Message ID. |
messages[].role | string | user (the person) or assistant (the agent). |
messages[].content | string | The text. |
messages[].created_at | string | null | When 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
| Code | When |
|---|---|
403 | API chat is not switched on for the organization. |
404 | Chat não encontrado. (chat not found). |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

