---
title: "Get Session State"
method: GET
path: "/sessions/states/"
tags: ["Sessions"]
---

# Get Session State

`GET /sessions/states/`

## Query parameters

- `session_id` string, required

## Response `200`

Successful Response

- SessionStateResponse
  - `count` integer
  - `session_state` SessionState
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `id` string, uuid, nullable — Own uuid7 pk (state_id).
    - `project_id` string, uuid, nullable
    - `session_id` string, required — Bare session correlator (not an FK).
    - `data` SessionStateData — Typed shape of the `data` column: the session's durable continuity state. Stored in the existing `data` JSON column (no dedicated columns) — every field is read and compared in the runner, never queried server-side, so a typed DTO gives the contract without a schema change.
      - `latest_agent_session_id` string, nullable — The latest-run harness's agentSessionId; a fast-path mirror of harness_sessions[<latest harness>].agent_session_id.
      - `latest_turn_index` integer, nullable — Conversation-level turn counter compared against each harness's turn_index.
      - `harness_sessions` object, nullable — Per-harness resume state, keyed by harness id (e.g. 'claude', 'pi'). Durable mirror of the staleness guard.
    - `sandbox_id` string, nullable — Remote sandbox id — the single source of truth resume pointer.
    - `flags` SessionStateFlags
    - `tags` object, nullable
    - `meta` object, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-07-25** `5a14788d939f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/sessions/states/get.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agenta-ai/apis/agenta-api/revisions/5a14788d939f?raw)
