List local sessions
api/compliance/apps/sessions/local/list
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/compliance/apps/sessions/local/list Changed · +25 / -18 lines
# List local sessions ## Query parameters ## Headers ## Returns ## Example ### Response (200) ## List local sessions ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
---- -title: List local sessions -url: https://platform.claude.com/docs/en/api/compliance/apps/sessions/local/list ---- +# List local sessions -## List local sessions +**GET** `/v1/compliance/apps/sessions/local` -**get** `/v1/compliance/apps/sessions/local` - List local sessions across the organizations the key may read. Results are ordered by `created_at` descending. Pagination is forward-only via `next_page`; there is no reverse cursor. -### Query Parameters +## Query parameters -- `created_at: optional object { gte, lt }` +- `created_at: optional object` - `gte: optional string` Only return sessions whose first inference call is at or after this time (RFC 3339; a UTC offset is required). + format: date-time + - `lt: optional string` Only return sessions whose first inference call is strictly before this time (RFC 3339; a UTC offset is required). + format: date-time + - `limit: optional number` Maximum results (default: 100, max: 500) + default: 100, maximum: 500, minimum: 1 + - `page: optional string` Opaque pagination token from a previous response's `next_page` field. Pass this to retrieve the next page of results. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice. -- `updated_at: optional object { gte }` +- `updated_at: optional object` - `gte: optional string` Only return sessions whose last inference call is at or after this time (RFC 3339; a UTC offset is required). Combines with `created_at.gte` / `created_at.lt`; the ordering and pagination are unchanged. Use it to poll for sessions that have been active since a previous pass — a session that becomes active later can only enter the result, never leave it. -### Header Parameters + format: date-time +## Headers + - `"x-api-key": optional string` -### Returns +## Returns -- `data: array of object { id, created_at, organization_uuid, 5 more }` +- `data: array of object` Page of local sessions, ordered by `created_at` descending; ties are broken by a fixed server-side order. `updated_at` never participates in the ordering; the `updated_at.gte` query parameter filters on it without changing the order or the pagination cursor.
Timestamp of the session's first retained inference call (RFC 3339, UTC). When a session's activity spans the child organization's retention boundary, calls older than the boundary are no longer reflected, so this value is the timestamp of the earliest retained call: always strictly after the boundary, never the boundary itself. + format: date-time + - `organization_uuid: string` UUID of the child organization the session belongs to
- `type: "compliance_local_session"` - - `"compliance_local_session"` + default: compliance_local_session - `updated_at: string` Timestamp of the session's last retained inference call (RFC 3339, UTC). Always at or after `created_at`. When a session's activity spans the child organization's retention boundary, calls older than the boundary are no longer reflected — but because retention removes only the oldest calls, this value (unlike `created_at`) is unaffected until the entire session has aged out. On the list endpoint this value is a lower bound: for a session still active at a page or `created_at.lt` window boundary it can momentarily lag the session's true last activity. Retrieving the session, or its messages, always reflects the exact latest retained call. - - `user: object { id, email_address }` + format: date-time + - `user: object` + The authenticated user at the time of the session. Always set; `user.id` is always populated. `user.email_address` is null when the user's account has been deleted or the user is no longer a member of an organization the key may read. - `id: string`
Opaque pagination cursor (prefixed `page_`) for the next page. Null when there is no further page. Treat as an opaque string; the format may change without notice. -### Example +## Example -```http +```bash curl https://api.anthropic.com/v1/compliance/apps/sessions/local \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +### Response (200) ```json {