# Get chat session (/docs/api-reference/chat-sessions/getChatSession)

> The session's state and, once it has ended, its full record in the same shape as Get call log: transcript, per-turn tool calls and timings, extracted variables, summary and sentiment. Analysis takes a few seconds after the end; poll until analysis_status is done.

**GET** `/chat/sessions/{session_id}`

The session's state and, once it has ended, its full record in the
same shape as Get call log: transcript, per-turn tool calls and
timings, extracted variables, summary and sentiment. Analysis takes a
few seconds after the end; poll until `analysis_status` is `done`.

```yaml
operationId: getChatSession
parameters:
  - name: session_id
    in: path
    required: true
    schema:
      type: integer
    description: The `session_id` from Create chat session.
responses:
  '200':
    description: The session.
    content:
      application/json:
        schema:
          type: object
          properties:
            session_id:
              type: integer
              example: 4521
            agent_id:
              type: integer
              example: 158910
            mode:
              type: string
              enum:
                - live
                - test
            status:
              type: string
              enum:
                - active
                - ended
            analysis_status:
              type: string
              nullable: true
              enum:
                - pending
                - done
              description: Null while the session is active.
            ended_by:
              type: string
              nullable: true
              enum:
                - agent
                - transfer
                - client
                - idle
                - turn_limit
              description: |
                How the chat ended: the agent ran its end call tool (`agent`) or
                transfer tool (`transfer`), you called End chat session (`client`),
                nobody wrote for 30 minutes (`idle`), or the agent sent 100 replies
                (`turn_limit`). Null while the chat is active.
            transferred_to:
              type: string
              nullable: true
              description: The number the agent transferred the customer to, if it did.
            transcript:
              type: array
              description: The whole chat, oldest first, once it has ended. The greeting has no customer line.
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - agent
                      - customer
                  text:
                    type: string
              example:
                - role: agent
                  text: Hi, this is Sam from Demo Dental. How can I help?
                - role: customer
                  text: I need to talk to a person.
                - role: agent
                  text: Sure, I am transferring you to +15551234567 now.
            call_log:
              type: object
              nullable: true
              additionalProperties: true
              description: The chat's record, as Get call log returns it. Null while the session is active.
  '401':
    description: Missing or invalid API key.
  '404':
    description: Session not found in your organization.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
              description: Machine-readable error code.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: |
                Stable, specific reason. Present on the newer endpoints (Voice
                cloning, WhatsApp); older endpoints return only `error`.
            request_id:
              type: string
              description: |
                Correlates this response with the server log. Present alongside
                `code`. Also sent as the `X-Request-Id` header.
        example:
          error: session_not_found
          error_description: Chat session not found or access denied
```

**curl**

```bash
curl -X GET "https://omnidim.io/api/v1/chat/sessions/{session_id}" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```