> ## Documentation Index
> Fetch the complete documentation index at: https://blackbox.dasha.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List chat sessions matching the supplied filters.

> Ordered by `last_activity` descending. Default filter is `state=active` —
pass `state=final` or `state=all` to broaden. `updated_after` is useful
for incremental sync.



## OpenAPI

````yaml https://blackbox.dasha.ai/swagger/v1/swagger.json get /api/v1/chats
openapi: 3.0.4
info:
  title: Dasha BlackBox Agent API
  description: API for managing AI agents and calls
  contact:
    name: DashaAI Team
    email: support@dasha.ai
  version: v1
servers:
  - url: https://blackbox.dasha.ai
    description: Dasha BlackBox Agent API
security:
  - ApiKey: []
  - OAuth: []
tags:
  - name: ActivityLogs
  - name: Agents
  - name: AgentTestCases
  - name: CallResults
  - name: Calls
  - name: Chats
  - name: Copilot
  - name: CustomerData
  - name: Mcp
  - name: Media
  - name: Misc
  - name: PronunciationDictionaries
  - name: Providers
  - name: SipAliases
  - name: SipCredentials
  - name: SipPhoneNumbers
  - name: TextChat
  - name: TwilioProvider
  - name: Voice
  - name: WebhookTest
  - name: WebIntegrations
  - name: WebSocket
    description: WebSocket endpoints for real-time communication
paths:
  /api/v1/chats:
    get:
      tags:
        - Chats
      summary: List chat sessions matching the supplied filters.
      description: >-
        Ordered by `last_activity` descending. Default filter is `state=active`
        —

        pass `state=final` or `state=all` to broaden. `updated_after` is useful

        for incremental sync.
      parameters:
        - name: agent_id
          in: query
          description: Filter to sessions driven by this agent id.
          schema:
            type: string
        - name: channel
          in: query
          description: Filter to sessions on this channel.
          schema:
            type: string
        - name: state
          in: query
          description: 'Lifecycle filter: `active` (default), `final`, or `all`.'
          schema:
            type: string
        - name: updated_after
          in: query
          description: Filter to sessions with last_activity after this timestamp.
          schema:
            type: string
            format: date-time
        - name: skip
          in: query
          description: Pagination offset (default 0).
          schema:
            type: integer
            format: int32
            default: 0
        - name: take
          in: query
          description: Page size (default 20, max 200).
          schema:
            type: integer
            format: int32
            default: 20
      responses:
        '200':
          description: Returns paginated list of sessions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionListResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    ChatSessionListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ChatSessionDto'
          description: Sessions on this page, ordered by `LastActivity` descending.
          nullable: true
        total_count:
          type: integer
          description: Total matching sessions across all pages (unfiltered by skip/take).
          format: int32
        skip:
          type: integer
          description: Echo of the request `skip`.
          format: int32
        take:
          type: integer
          description: Echo of the request `take`.
          format: int32
      additionalProperties: false
      description: Paginated result of `GET /api/v1/chats`.
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ChatSessionDto:
      type: object
      properties:
        id:
          type: string
          description: Session identifier.
          format: uuid
        agent_id:
          type: string
          description: Agent driving this session. Frozen at open.
          nullable: true
        channel:
          type: string
          description: Channel name (`web`, `twilio_sms`, …).
          nullable: true
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageDto'
          description: Full conversation transcript so far, in send order.
          nullable: true
        created_time:
          type: string
          description: Session creation timestamp (UTC).
          format: date-time
        last_activity:
          type: string
          description: >-
            Most recent activity timestamp (inbound, outbound or assistant
            turn).
          format: date-time
        ttl_seconds:
          type: integer
          description: Inactivity timeout in seconds; null when no TTL applies.
          format: int32
          nullable: true
        is_final:
          type: boolean
          description: True once the session has terminated.
        status:
          type: string
          description: >-
            Status mirror of
            DashaAI.BlackBox.AgentAPI.TextChat.Dtos.Chats.ChatSessionDto.IsFinal
            for list-endpoint filtering (`active` /

            `final`).
          nullable: true
        final_reason:
          type: string
          description: Reason for finalisation (`ttl`, `user_end`, `agent_finish`, …).
          nullable: true
      additionalProperties: false
      description: >-
        Public projection of a chat session — what callers see via `GET
        /api/v1/chats/{id}`

        and the list endpoint. Deliberately omits the orchestration `State`
        blob, the

        `ExternalIdHash`, and the worker hot-flags; those are server-internal.
    ChatMessageDto:
      type: object
      properties:
        role:
          type: string
          description: One of "user", "assistant", "system".
          nullable: true
        content:
          type: string
          description: >-
            Plain-text message content. Null when the assistant message only
            contains tool calls.
          nullable: true
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ChatToolCallDto'
          description: >-
            Tool calls produced by the assistant this turn, bundled with their
            responses.
          nullable: true
        time:
          type: string
          description: >-
            Real wall-clock time of the message. The server stamps the messages
            it produces and

            echoes back any client-supplied value; it is used verbatim for the
            call transcript /

            post-call analysis instead of a synthesized clock. One timestamp per
            chat message is

            enough — chat messages are point-in-time events, unlike voice
            utterances. Optional.
          format: date-time
          nullable: true
      additionalProperties: false
      description: >-
        Wire-format text-chat message. Supports user / assistant / system roles.

        Tool invocations are bundled — a single assistant message carries the
        tool call(s)

        alongside their executed response(s) via
        DashaAI.BlackBox.AgentAPI.TextChat.Dtos.ChatMessageDto.ToolCalls.
    ChatToolCallDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            Tool call identifier propagated through the OpenAI round-trip.
            Required.
          nullable: true
        name:
          type: string
          description: >-
            Tool name as registered with the agent (built-in, agent-defined
            function, or MCP).
          nullable: true
        arguments:
          description: >-
            Tool arguments emitted by the LLM, as a JSON object. May be omitted
            for tools with no parameters.
        response:
          description: >-
            Tool response. Set after the server executes the tool. Null while
            the request is still in flight

            (only happens internally — wire-format messages from the client
            always include the response).
          nullable: true
      additionalProperties: false
      description: >-
        Combined tool call: the LLM-generated request and the executed response
        in a single object.

        Wire-format choice — internally the orchestrator translates to OpenAI's
        split assistant/tool format.
  securitySchemes:
    ApiKey:
      type: http
      description: API Key Authentication (Bearer {key})
      scheme: Bearer
    OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.dasha.ai/connect/authorize
          scopes:
            platform_api: Platform API

````