---
title: "Get persistent session"
method: GET
path: "/v1/projects/{project_id}/sessions/{environment_id}/{session_id}"
tags: ["sessions"]
---

# Get persistent session

`GET /v1/projects/{project_id}/sessions/{environment_id}/{session_id}`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/sessions/{environment_id}/{session_id}`
- Auth: HTTP bearer

Get one active persistent session by its exact `app_name`, `user_id`, and session ID, with its most recent events. Session state omits keys in the reserved `connic:` namespace. Expired and internal sessions return 404.

Required permission: `retrieval.manage`.

## Path parameters

- `project_id` string, uuid, required
- `environment_id` string, uuid, required
- `session_id` string, required

## Query parameters

- `app_name` string, required: The session's `app_name` from `GET /sessions/{environment_id}`.
- `user_id` string, required: The session's `user_id` from `GET /sessions/{environment_id}`.
- `event_limit` integer: Maximum number of most recent events to return.

## Response `200`

Successful Response

- PersistentSessionDetail
  - `id` string, uuid, required
  - `session_id` string, required: `session-<agent name>-<key>`, where the key is the value resolved from the agent's `session.key`, or `default` when no key is set.
  - `app_name` string, required: `runner-` followed by the agent name with hyphens replaced by underscores.
  - `user_id` string, required: User identity of the session. Pass it with `app_name` to get or delete this exact session.
  - `state` object, required: Session state saved by the agent's runs. Keys in the reserved `connic:` namespace are omitted.
  - `event_count` integer, required: Total events recorded in the session.
  - `expires_at` string, date-time, nullable: Expiry time, extended each time a run uses the session; null when the agent sets no `session.ttl`.
  - `last_update_time` string, date-time, required: Time a run last used or updated the session.
  - `created_at` string, date-time, required
  - `events` PersistentSessionEvent[], required: Most recent events in ascending `event_index` order, up to `event_limit`.
    - `event_index` integer, required: Position of the event in the session, starting at 0.
    - `created_at` string, date-time, required
    - `event_data` object, required: Recorded run event, such as a message, model response, tool call, or tool result. Inline file data and provider-specific state are omitted.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `404`: The resource does not exist in this project.
- `422`: Validation Error
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/connic/apis/connic-api.md) · [All operations](https://skmtc.dev/connic/apis/connic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/connic/apis/connic-api/revisions/482932da5fbe?raw)
