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

# List persistent sessions

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

## Request

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

List active persistent agent sessions for one environment, most recently updated first. Expired and internal sessions are excluded from `sessions`, `total`, and `app_names`. Session state omits keys in the reserved `connic:` namespace.

Required permission: `retrieval.manage`.

## Path parameters

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

## Query parameters

- `search` string, nullable: Case-insensitive session ID pattern. Text is matched anywhere; an unescaped percent (%) matches any sequence and an unescaped underscore (_) matches one character. An empty value applies no search filter.
- `app_name` string, nullable: Only sessions with this exact `app_name`, as listed in `app_names`. An empty value applies no filter.
- `limit` integer: Maximum number of sessions to return.
- `offset` integer: Number of sessions to skip.

## Response `200`

Successful Response

- SessionsResponse
  - `sessions` PersistentSession[], required: Sessions on this page, most recently updated first.
    - `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
  - `total` integer, required: Sessions matching the filters, ignoring `limit` and `offset`.
  - `app_names` string[], required: Distinct `app_name` values across all sessions in the environment, regardless of filters.

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