> ## 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.

# Get chat

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

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


## OpenAPI

````yaml /api/agent-chat/v3.6/openapi.json post /action/get_chat
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.6'
servers:
  - url: https://api.livechatinc.com/v3.6/agent
    description: Production server
security: []
paths:
  /action/get_chat:
    post:
      tags:
        - Chats
      summary: Get chat
      description: Returns a thread that the current agent has access to in a given chat.
      operationId: get-chat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetChatRequest'
            example:
              chat_id: PWJ8Y4THAV
              thread_id: K600PKZON8
      responses:
        '200':
          description: Chat with the requested thread.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetChatResponse'
              example:
                id: PJ0MRSHTDG
                thread:
                  id: K600PKZON8
                  created_at: '2026-06-07T07:11:28.288340Z'
                  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
                  summary:
                    status: ok
                    text: Agent greets with a short message.
                    updated_at: '2026-06-21T07:08:16.125000Z'
                  properties:
                    0805e283233042b37f460ed8fbf22160:
                      string_property: string_value
                  access:
                    group_ids:
                      - 0
                  previous_thread_id: K600PKZOM8
                  next_thread_id: K600PKZOO8
                  customer_visit:
                    ip: 1.2.3.4
                    user_agent: >-
                      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)
                      AppleWebKit/537.36 (KHTML, like Gecko)
                      Chrome/53.0.2785.116 Safari/537.36
                    geolocation:
                      latitude: '-14.6973803'
                      longitude: '-75.1266898'
                      country: Poland
                      country_code: PL
                      region: Dolnoslaskie
                      city: Wroclaw
                      timezone: Europe/Warsaw
                users:
                  - id: b7eff798-f8df-4364-8059-649c35c9ed0c
                    type: customer
                    present: true
                    created_at: '2026-06-17T08:53:20.693553+01:00'
                    statistics:
                      chats_count: 1
                    agent_last_event_created_at: '2026-06-17T09:04:05.239000+01:00'
                  - id: smith@example.com
                    name: Agent Smith
                    email: smith@example.com
                    type: agent
                    present: true
                    avatar: https://example.com/avatar.jpg
                    visibility: all
                properties:
                  0805e283233042b37f460ed8fbf22160:
                    string_property: string_value
                access:
                  group_ids:
                    - 0
                is_followed: true
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - chats--all:ro
components:
  schemas:
    GetChatRequest:
      type: object
      required:
        - chat_id
      properties:
        chat_id:
          type: string
          description: The chat ID.
        thread_id:
          type: string
          description: 'The thread ID. Default: the latest thread (if exists).'
    GetChatResponse:
      type: object
      properties:
        id:
          type: string
          description: Chat ID.
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: >-
            Array of [user objects](/api/agent-chat/v3.6/data-structures#users)
            (agents and customers).
        thread:
          $ref: '#/components/schemas/Thread'
        properties:
          $ref: '#/components/schemas/Properties'
        access:
          $ref: '#/components/schemas/Access'
        is_followed:
          type: boolean
          description: Whether the chat is followed by the requester.
    User:
      type: object
      description: >-
        User object (agent or customer). For full field details, see the [Agent
        Chat API data structures
        reference](/api/agent-chat/v3.6/data-structures).
      properties:
        id:
          type: string
          description: User ID.
        type:
          type: string
          enum:
            - agent
            - customer
          description: User type.
        name:
          type: string
          description: User's display name.
        email:
          type: string
          description: User's email address (agents only).
        present:
          type: boolean
          description: Whether the user is currently present in the chat.
    Thread:
      type: object
      description: >-
        Thread object. For full field details, see the [Agent Chat API data
        structures reference](/api/agent-chat/v3.6/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).
    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.6/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.
    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.6/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'
  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

````