---
title: "List sessions for a trail"
method: GET
path: "/api/v1/trails/{forge}/{owner}/{repo}/{number}/sessions"
tags: ["Trails", "Sessions"]
---

# List sessions for a trail

`GET /api/v1/trails/{forge}/{owner}/{repo}/{number}/sessions`

Returns sessions attached to checkpoints on the trail's current or historical commit delta. The session data is read from the entire-api repository sessions endpoint.

## Path parameters

- `forge` string, required
- `owner` string, required
- `repo` string, required
- `number` string, required

## Query parameters

- `cursor` string
- `limit` integer

## Response `200`

Trail sessions

- object
  - `trail_id` string, required
  - `trail_number` number, required
  - `repo_full_name` string, required
  - `branch` string, nullable, required
  - `sessions` object[], required
    - `sessionId` string, required
    - `displayName` string, required
    - `customName` string, nullable, required
    - `isPublic` boolean, required
    - `agent` string, nullable, required
    - `model` string, nullable, required
    - `kind` 'agent_review', nullable, required
    - `prompt` string, nullable, required
    - `firstCommitAuthorUsername` string, nullable, required
    - `startedAt` string, required
    - `lastActivityAt` string, required
    - `checkpointCount` number, required
    - `stepCount` number, required
    - `inputTokens` number, nullable
    - `outputTokens` number, nullable
    - `cacheCreationTokens` number, nullable
    - `cacheReadTokens` number, nullable
    - `attributionAgentLines` number, nullable
    - `attributionHumanAdded` number, nullable
    - `attributionHumanModified` number, nullable
    - `attributionHumanRemoved` number, nullable
    - `attributionTotalCommitted` number, nullable
    - `attributionCalculatedAt` string, nullable
  - `next_cursor` string, nullable, required
  - `app_has_access` boolean, nullable, required
  - `session_branch_exists` boolean, nullable, required
  - `history_status` 'pending' | 'syncing' | 'complete' | 'error', nullable, required
  - `history_complete` boolean, required
  - `source` 'entire-api' | 'none', required
  - `upstream_source` string, nullable, required

## Other responses

- `400` — Invalid query
- `404` — Trail not found
- `409` — Trail session delta cannot be computed completely
- `501` — Trail sessions require a browser session for entire-api access
- `502` — entire-api could not read the repository history
- `503` — entire-api unavailable

---

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