> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-restapi-chat-api-eng-37141.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> List CometChat message threads with REST API to fetch thread conversations across your app.

# List Threads

For the complete error reference, see [Error Guide](/articles/error-guide).


## OpenAPI

````yaml get /threads
openapi: 3.0.0
info:
  title: Chat APIs
  description: Manage messages, users, groups for a particular app using our Chat API.
  version: '3.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: API Keys
    description: The API keys are used to authorise the APIs
  - name: Roles
    description: The roles are used to give user access rights
  - name: Users
    description: The REST collection for users.
  - name: Auth Tokens
    description: The auth tokens are used to login end users using client SDKs.
  - name: Blocked Users
    description: The REST collections for blocked users.
  - name: Friends
    description: List,add and remove friends by passing UID in path variables
  - name: Groups
    description: The REST collections for groups.
  - name: Banned Users
    description: Ban and Unban user by passing other UID in path variables.
  - name: Group Members
    description: The REST collections for group members.
  - name: Messages
    description: The REST collections for messages.
  - name: Conversations
    description: The REST collections for conversations.
  - name: Restrict Features
    description: Allows Restricting Features
  - name: Metrics
    description: Allows accessing Data Metrics
  - name: Triggers
    description: Allows adding triggers to a webhook.
  - name: Webhooks
    description: Allows accessing Webhooks.
  - name: Notifications
    description: Allows configuring Notifications core.
  - name: Moderation
    description: The REST collections for Moderations.
paths:
  /threads:
    get:
      tags:
        - Messages
      summary: List Threads
      description: Fetches the list of threads.
      operationId: list-all-threads
      parameters:
        - $ref: '#/components/parameters/onBehalfOf'
        - name: limit
          in: query
          description: >-
            Number of threads to be fetched in a request. The default value is
            100 and the maximum value is 1000.
          schema:
            type: integer
            default: 100
        - name: affix
          in: query
          description: Cursor direction used for pagination.
          schema:
            type: string
            enum:
              - append
              - prepend
        - name: updatedAt
          in: query
          description: Cursor value (updatedAt) used for pagination.
          schema:
            type: integer
        - name: participatedByMe
          in: query
          description: Lists only the threads the user has participated in.
          schema:
            type: boolean
        - name: withUnreadReplyCount
          in: query
          description: Enriches each thread with the per-user unread reply count.
          schema:
            type: boolean
        - name: withMentionCount
          in: query
          description: Enriches each thread with the per-user unread mention count.
          schema:
            type: boolean
      responses:
        '200':
          description: List Threads
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items: {}
                  meta:
                    type: object
                type: object
              example:
                data:
                  - id: '4002'
                    conversationId: cometchat-uid-1_user_cometchat-uid-2
                    sender: cometchat-uid-1
                    receiverType: user
                    receiver: cometchat-uid-2
                    category: message
                    type: text
                    data:
                      entities:
                        receiver:
                          entity:
                            avatar: >-
                              https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp
                            conversationId: cometchat-uid-1_user_cometchat-uid-2
                            createdAt: 1783932561
                            lastActiveAt: 1783932561
                            name: George Alan
                            role: default
                            status: offline
                            uid: cometchat-uid-2
                          entityType: user
                        sender:
                          entity:
                            avatar: >-
                              https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp
                            createdAt: 1783932561
                            lastActiveAt: 1783932561
                            name: Andrew Joseph
                            role: default
                            status: offline
                            tags:
                              - abc
                            uid: cometchat-uid-1
                            updatedAt: 1783944695
                          entityType: user
                      moderation:
                        rule:
                          id: customrule
                          name: custom-rule
                        status: disapproved
                      text: '123'
                    sentAt: 1784014343
                    updatedAt: 1784014370
                    replyCount: 1
                    lastReply:
                      id: '4003'
                      muid: ''
                      conversationId: cometchat-uid-1_user_cometchat-uid-2
                      sender: cometchat-uid-1
                      receiverType: user
                      receiver: cometchat-uid-2
                      category: message
                      type: text
                      data:
                        entities:
                          receiver:
                            entity:
                              avatar: >-
                                https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp
                              conversationId: cometchat-uid-1_user_cometchat-uid-2
                              createdAt: 1783932561
                              lastActiveAt: 1783932561
                              name: George Alan
                              role: default
                              status: offline
                              uid: cometchat-uid-2
                            entityType: user
                          sender:
                            entity:
                              avatar: >-
                                https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp
                              createdAt: 1783932561
                              lastActiveAt: 1783932561
                              name: Andrew Joseph
                              role: default
                              status: offline
                              tags:
                                - abc
                              uid: cometchat-uid-1
                              updatedAt: 1783944695
                            entityType: user
                        moderation:
                          status: approved
                        text: Hello in thread
                      sentAt: 1784014370
                      editedAt: null
                      editedBy: ''
                      deliveredAt: null
                      readAt: null
                      deletedAt: null
                      updatedAt: 1784014370
                meta:
                  current:
                    limit: 100
                    count: 1
                  next:
                    affix: append
                    updatedAt: 1784014370
      security:
        - apiKey: []
components:
  parameters:
    onBehalfOf:
      name: onBehalfOf
      in: header
      description: UID of the user on whose behalf the action is performed.
      schema:
        type: string
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````