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

# Get Chats

> Retrieves a paginated list of active chats for a worker. Supports cursor-based pagination for infinite scroll.

<Info>
  This endpoint uses cursor-based pagination for infinite scroll. Pass `last_seen_id` with the ID of the last chat from the previous page to fetch the next set of results. Omit it for the first page.
</Info>

<Tip>
  Use `search_term` to filter chats by title, or set `all_chats` to `true` to include inactive chats.
</Tip>


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json GET /workers/{id}/chats
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /workers/{id}/chats:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Worker ID
    get:
      tags:
        - Workers
      summary: Get Chats
      description: >-
        Retrieves a paginated list of active chats for a worker. Supports
        cursor-based pagination for infinite scroll.
      operationId: get-chats
      parameters:
        - schema:
            type: boolean
          in: query
          name: all_chats
          description: Fetches all chats if true
        - schema:
            type: string
          in: query
          name: search_term
          description: Title search query for chats
        - schema:
            type: string
          in: query
          name: last_seen_id
          description: ID of the last chat from the previous page. Omit for the first page.
        - schema:
            type: integer
            default: 20
          in: query
          name: limit
          description: Maximum number of chats to return per page.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  Example 1:
                    has_more: true
                    chats:
                      - id: DlTuNEsxI1
                        auto_add_workers: '1'
                        event_id: null
                        chat_admin: '1'
                        silenced: '0'
                        on_chat: '1'
                        date_created: '2024-01-05T17:09:00.000Z'
                        name: Chris Davissss, 11111 worker
                        most_recent_message_id: rxsVGOYHC9u
                        locked: '0'
                        last_message_timestamp: '2024-01-05T17:10:00.000Z'
                        message: Hello there
                        name_first: Chris Davissss
                        selected_picture_location: example/1
                        chats_order: '2024-01-05T17:10:00.000Z'
                        unread_count: '0'
                      - id: fVjAOhiN7j
                        auto_add_workers: '0'
                        event_id: null
                        chat_admin: '1'
                        silenced: '0'
                        on_chat: '1'
                        date_created: '2021-04-19T12:24:00.000Z'
                        name: Chris Davissss, Dorcas Glassford
                        most_recent_message_id: HavJuiLxDiR
                        locked: '0'
                        last_message_timestamp: '2021-04-19T12:24:00.000Z'
                        message: hello
                        name_first: Chris Davissss
                        selected_picture_location: example/1
                        chats_order: '2021-04-19T12:24:00.000Z'
                        unread_count: '0'
                properties:
                  chats:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        auto_add_workers:
                          type: integer
                          minimum: 0
                          maximum: 1
                        event_id:
                          type: string
                          nullable: true
                        chat_admin:
                          type: integer
                          minimum: 0
                          maximum: 1
                        silenced:
                          type: integer
                          minimum: 0
                          maximum: 1
                        on_chat:
                          type: integer
                          minimum: 0
                          maximum: 1
                        date_created:
                          type: string
                        name:
                          type: string
                        most_recent_message_id:
                          type: string
                        locked:
                          type: integer
                          minimum: 0
                          maximum: 1
                        last_message_timestamp:
                          type: string
                        message:
                          type: string
                        name_first:
                          type: string
                        selected_picture_location:
                          type: string
                        chats_order:
                          type: string
                        unread_count:
                          type: integer
                          minimum: 0
                  has_more:
                    type: boolean
                    description: Whether there are more chats available beyond this page.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid limit parameter:
                  value:
                    code: WRK-3500
                    error: Invalid limit parameter
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid or missing API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Worker not found:
                  value:
                    code: WRK-300
                    error: Worker not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Failed to get chats:
                  value:
                    code: WRK-3300
                    error: Failed to get chats
components:
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````