Chat
List chats
Chats opened through the API, newest first, without their messages.
GET https://api.diska.ai/v1/chats
Scope: chats:write
Parameters
Query string
| Name | Type | Required | Description |
|---|---|---|---|
agent_id | string | null | No | Only chats with this agent. Up to 64 characters. |
status | string | null | No | active or ended. |
limit | integer | No | How many per page. Between 1 and 100. Default: 50. |
offset | integer | No | How many to skip. Minimum 0. Default: 0. |
Examples
curl "https://api.diska.ai/v1/chats" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/chats",
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', {
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');
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/chatsStarts with dsk_. It stays in this browser tab only.
query
query
query
query
Enter an API key (dsk_…).
Response 200
| Field | Type | Description |
|---|---|---|
items | array | The chats. |
items[].id | string | Chat ID (the same as GET /v1/calls/{call_id}). |
items[].agent_id | string | The agent. |
items[].status | string | active or ended. |
items[].contact | string | null | Who is chatting, as you stated it. |
items[].metadata | object | Your metadata, returned as sent. |
items[].created_at | string | Creation date (ISO 8601). |
items[].ended_at | string | null | When it ended. |
items[].end_reason | string | null | ended_by_api, agent_ended or inactivity. |
total | integer | Total with these filters. |
limit | integer | Page size. |
offset | integer | This page's offset. |
{
"items": [
{
"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"
}
],
"total": 1,
"limit": 50,
"offset": 0
}
Errors
| Code | When |
|---|---|
403 | API chat is not switched on for the organization. |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

