---
title: "Get Session"
method: GET
path: "/api/chat/sessions/{session_id}"
tags: ["v2", "chat", "chat"]
---

# Get Session

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

Retrieve the details of a specific chat session.

Supports cursor-based pagination via ``limit`` and ``before_sequence``.
When no pagination params are provided, returns the most recent messages.

## Path parameters

- `session_id` string, required

## Query parameters

- `limit` integer
- `before_sequence` integer, nullable

## Response `200`

Successful Response

- SessionDetailResponse — Response model providing complete details for a chat session, including messages.
  - `id` string, required
  - `created_at` string, required
  - `updated_at` string, required
  - `user_id` string, nullable, required
  - `chat_status` string
  - `messages` object[], required
  - `active_stream` ActiveStreamInfo — Information about an active stream for reconnection.
    - `turn_id` string, required
    - `last_message_id` string, required
    - `started_at` string, nullable
  - `has_more_messages` boolean
  - `oldest_sequence` integer, nullable
  - `total_prompt_tokens` integer
  - `total_completion_tokens` integer
  - `metadata` ChatSessionMetadata — Typed metadata stored in the ``metadata`` JSON column of ChatSession. Add new session-level flags here instead of adding DB columns — no migration required for new fields as long as a default is provided.
    - `dry_run` boolean
    - `llm_auth_provider` 'platform' | 'codex'
    - `llm_credential_id` string, nullable
    - `builder_graph_id` string, nullable
    - `source_platform` string, nullable
    - `origin` 'interactive' | 'automation', nullable
    - `kind` string
    - `dream_pass_id` string, nullable
    - `delegated_by_expert_id` string, nullable
    - `delegated_by_session_id` string, nullable
    - `handed_off_from_expert_id` string, nullable
    - `pending_question` PendingQuestion — The last unanswered question a session asked the user.
      - `text` string, required
      - `asked_at` string, date-time, required
  - `expert_id` string, nullable

## Other responses

- `401` — Authentication required
- `422` — Validation Error

## Changes

- **2026-08-23** `9f56862bbc8a` — 5 info
  - added the optional property `metadata/delegated_by_expert_id` to the response with the `200` status
  - added the optional property `metadata/delegated_by_session_id` to the response with the `200` status
  - added the optional property `metadata/handed_off_from_expert_id` to the response with the `200` status
  - added the optional property `metadata/origin` to the response with the `200` status
  - …1 more
- **2026-08-12** `316dc5984754` — 3 info
  - added the optional property `metadata/llm_auth_provider` to the response with the `200` status
  - added the optional property `metadata/llm_credential_id` to the response with the `200` status
  - the `metadata` response's property default value changed from `{"dry_run":false,"kind":"normal"}` to `{"dry_run":false,"llm_auth_provider":"platform","kind":"normal"}` for the status `200`
- **2026-07-29** `3840642ede61` — 1 info
  - added the optional property `expert_id` to the response with the `200` status
- **2026-06-11** `ab66703bd004` — 3 info
  - added the optional property `metadata/dream_pass_id` to the response with the `200` status
  - added the optional property `metadata/kind` to the response with the `200` status
  - the `metadata` response's property default value changed from `{"dry_run":false}` to `{"dry_run":false,"kind":"normal"}` for the status `200`
- …earlier changes not shown

[Full history](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/changes/api/chat/sessions/:session_id/get.md)

---

[API](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/revisions/5dc375899754/schema)
