> ## Documentation Index
> Fetch the complete documentation index at: https://quintsecurity.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sessions

> Session lifecycle tracking and querying

# Sessions API

Sessions represent a logical unit of AI agent activity -- a single conversation, task, or workflow. The Quint daemon detects session boundaries automatically using fingerprinting and conversation anchoring, and reports lifecycle events to the cloud.

## Endpoints

<CardGroup cols={2}>
  <Card title="POST /v1/sessions/ingest" href="/api/endpoint/post-sessions-ingest">
    Session lifecycle event ingestion (rate-limited). Used by the daemon to report session start, update, and end events.
  </Card>

  <Card title="GET /v1/sessions" href="/api/endpoint/get-sessions">
    List sessions with filtering by state, platform, root\_only, and since.
  </Card>

  <Card title="GET /v1/sessions/{id}" href="/api/endpoint/get-session-detail">
    Session detail including children and risk summary.
  </Card>

  <Card title="GET /v1/sessions/{id}/events" href="/api/endpoint/get-session-events">
    All events belonging to a specific session.
  </Card>

  <Card title="GET /v1/sessions/{id}/children" href="/api/endpoint/get-session-children">
    Child sessions spawned from a parent session.
  </Card>
</CardGroup>

## Session Fields

| Field          | Type     | Description                                                |
| -------------- | -------- | ---------------------------------------------------------- |
| `id`           | UUID     | Session identifier (UUID v5)                               |
| `session_name` | string   | Human-readable session name                                |
| `model`        | string   | LLM model used in the session                              |
| `signing_id`   | string   | Code signing identity of the agent process                 |
| `state`        | string   | Current state: `active`, `idle`, `ended`                   |
| `platform`     | string   | Agent platform (e.g., `claude-code`, `cursor`, `windsurf`) |
| `parent_id`    | UUID     | Parent session ID for hierarchical tracking                |
| `started_at`   | datetime | When the session began                                     |
| `ended_at`     | datetime | When the session ended (null if active)                    |

## Hierarchical Sessions

Sessions support parent/child relationships. When an AI agent spawns a sub-agent or delegates work, the child session is linked to its parent:

```
Root Session (Claude Code)
  ├── Child Session (MCP server invocation)
  └── Child Session (Sub-agent task)
       └── Grandchild Session (Nested delegation)
```

Use `root_only=true` on `GET /v1/sessions` to see only top-level sessions, then drill into children via `GET /v1/sessions/{id}/children`.

## Filtering

```bash theme={null}
# Active sessions only
curl "https://api.quintai.dev/v1/sessions?state=active" \
  -H "Authorization: Bearer qt_deploy_YOUR_TOKEN"

# Root sessions on a specific platform
curl "https://api.quintai.dev/v1/sessions?root_only=true&platform=claude-code" \
  -H "Authorization: Bearer qt_deploy_YOUR_TOKEN"

# Sessions since a timestamp
curl "https://api.quintai.dev/v1/sessions?since=2026-04-11T00:00:00Z" \
  -H "Authorization: Bearer qt_deploy_YOUR_TOKEN"
```

## Session Detail

The `GET /v1/sessions/{id}` endpoint returns the session along with its child sessions and a risk summary:

```json theme={null}
{
  "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "session_name": "Fix auth middleware",
  "model": "claude-sonnet-4-20250514",
  "signing_id": "com.anthropic.claude-code",
  "state": "ended",
  "platform": "claude-code",
  "parent_id": null,
  "started_at": "2026-04-12T14:00:00Z",
  "ended_at": "2026-04-12T14:45:00Z",
  "children": [],
  "risk_summary": {
    "total_events": 47,
    "max_risk": 35,
    "avg_risk": 8
  }
}
```
