> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List threads

> Returns threads that the current agent has access to in a given chat.

**Required scopes:** <Tooltip tip="To find threads from all groups.">`chats--all:ro`</Tooltip> or <Tooltip tip="To find threads from groups that the requester (related to the token) is a member of.">`chats--access:ro`</Tooltip>


## OpenAPI

````yaml /api/agent-chat/v3.5/openapi.json post /action/list_threads
openapi: 3.0.0
info:
  title: Agent Chat API
  description: >-
    The Agent Chat API allows you to manage chats, threads, events, and agent
    state.
  version: '3.5'
servers:
  - url: https://api.livechatinc.com/v3.5/agent
    description: Production server
security: []
paths:
  /action/list_threads:
    post:
      tags:
        - Chats
      summary: List threads
      description: Returns threads that the current agent has access to in a given chat.
      operationId: list-threads
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListThreadsRequest'
            example:
              chat_id: PWJ8Y4THAV
      responses:
        '200':
          description: Threads in the chat.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListThreadsResponse'
              example:
                threads:
                  - id: K600PKZON8
                    created_at: '2026-06-17T07:57:41.512000Z'
                    active: true
                    user_ids:
                      - b7eff798-f8df-4364-8059-649c35c9ed0c
                      - smith@example.com
                    events:
                      - id: Q20N9CKRX2_1
                        created_at: '2026-06-17T07:57:41.512000Z'
                        visibility: all
                        type: message
                        text: Hello
                        author_id: smith@example.com
                    properties: {}
                    access:
                      group_ids:
                        - 0
                    previous_thread_id: K600PKZOM8
                    next_thread_id: K600PKZOO8
                found_threads: 42
                next_page_id: MTUxNzM5ODEzMTQ5Ng==
                previous_page_id: MTUxNzM5ODEzMTQ5Nw==
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - chats--all:ro
components:
  schemas:
    ListThreadsRequest:
      type: object
      required:
        - chat_id
      properties:
        chat_id:
          type: string
          description: The chat ID.
        sort_order:
          type: string
          enum:
            - asc
            - desc
          default: desc
          description: '`asc` for oldest threads first, `desc` for newest threads first.'
        limit:
          type: integer
          default: 3
          maximum: 100
          description: >-
            Maximum number of records per page. Cannot be used together with
            `min_events_count`.
        page_id:
          type: string
          description: Pagination token. Cannot be used together with `min_events_count`.
        min_events_count:
          type: integer
          minimum: 1
          maximum: 100
          description: >-
            Minimum number of events to return across threads. Returns as many
            latest threads as needed to meet this condition. Cannot be used
            together with `limit`, `page_id`, or `filters`.
        filters:
          type: object
          description: Thread filters. Cannot be used together with `min_events_count`.
          properties:
            from:
              type: string
              description: >-
                Start date in RFC3339 format with microseconds:
                `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
            to:
              type: string
              description: >-
                End date in RFC3339 format with microseconds:
                `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`.
    ListThreadsResponse:
      type: object
      properties:
        threads:
          type: array
          items:
            $ref: '#/components/schemas/Thread'
          description: >-
            Array of [thread
            objects](/api/agent-chat/v3.5/data-structures#threads).
        found_threads:
          type: integer
          description: Total number of found threads.
        next_page_id:
          type: string
          description: Pagination token for the next page.
        previous_page_id:
          type: string
          description: Pagination token for the previous page.
    Thread:
      type: object
      description: >-
        Thread object. For full field details, see the [Agent Chat API data
        structures reference](/api/agent-chat/v3.5/data-structures).
      properties:
        id:
          type: string
          description: Thread ID.
        chat_id:
          type: string
          description: Chat ID.
        active:
          type: boolean
          description: Whether the thread is active.
        user_ids:
          type: array
          items:
            type: string
          description: IDs of users present in the thread.
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
          description: Thread events.
        properties:
          $ref: '#/components/schemas/Properties'
        access:
          $ref: '#/components/schemas/Access'
        created_at:
          type: string
          format: date-time
          description: Thread creation timestamp (RFC3339 with microseconds).
        previous_thread_id:
          type: string
          description: ID of the previous thread in the chat (if exists).
        next_thread_id:
          type: string
          description: ID of the next thread in the chat (if exists).
    Event:
      type: object
      description: >-
        Event object. Event types include `message`, `file`, `form`,
        `filled_form`, `rich_message`, `custom`, `system_message`, and `system`.
        For full field details per type, see the [Agent Chat API data structures
        reference](/api/agent-chat/v3.5/data-structures).
      properties:
        id:
          type: string
          description: Event ID.
        type:
          type: string
          description: Event type.
        created_at:
          type: string
          format: date-time
          description: Event creation timestamp (RFC3339 with microseconds).
        author_id:
          type: string
          description: ID of the event author.
        visibility:
          type: string
          enum:
            - all
            - agents
          description: Event visibility.
        properties:
          $ref: '#/components/schemas/Properties'
    Properties:
      type: object
      description: Custom properties organized by namespace, then property name.
      additionalProperties:
        type: object
        additionalProperties: true
    Access:
      type: object
      description: >-
        [Access object](/api/agent-chat/v3.5/data-structures#access) defining
        which groups can access the chat or thread.
      properties:
        group_ids:
          type: array
          items:
            type: integer
          description: Array of group IDs with access. `0` means all groups.
  securitySchemes:
    PersonalAccessToken:
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
      type: http
      scheme: basic
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of

````