Skip to main content
GET
/
api
/
v1
/
chats
List chat sessions matching the supplied filters.
const options = {method: 'GET'};

fetch('https://blackbox.dasha.ai/api/v1/chats', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "items": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "agent_id": "<string>",
      "channel": "<string>",
      "messages": [
        {
          "role": "<string>",
          "content": "<string>",
          "tool_calls": [
            {
              "id": "<string>",
              "name": "<string>",
              "arguments": "<unknown>",
              "response": "<unknown>"
            }
          ],
          "time": "2023-11-07T05:31:56Z"
        }
      ],
      "created_time": "2023-11-07T05:31:56Z",
      "last_activity": "2023-11-07T05:31:56Z",
      "ttl_seconds": 123,
      "is_final": true,
      "status": "<string>",
      "final_reason": "<string>"
    }
  ],
  "total_count": 123,
  "skip": 123,
  "take": 123
}

Query Parameters

agent_id
string

Filter to sessions driven by this agent id.

channel
string

Filter to sessions on this channel.

state
string

Lifecycle filter: active (default), final, or all.

updated_after
string<date-time>

Filter to sessions with last_activity after this timestamp.

skip
integer<int32>
default:0

Pagination offset (default 0).

take
integer<int32>
default:20

Page size (default 20, max 200).

Response

Returns paginated list of sessions.

Paginated result of GET /api/v1/chats.

items
object[] | null

Sessions on this page, ordered by LastActivity descending.

total_count
integer<int32>

Total matching sessions across all pages (unfiltered by skip/take).

skip
integer<int32>

Echo of the request skip.

take
integer<int32>

Echo of the request take.