Create a session
POST /v1/sessions
Manually creates a session. In normal use, sessions are created automatically the first time an event is ingested via POST /v1/hooks/ingest. Use this endpoint only when you need to pre-register a session ID or attach metadata before events arrive.
Request body
Optional session ID. If omitted, a UUID is generated. Providing an existing ID is safe — the request returns
409 rather than overwriting the existing session.Tool or integration identifier (e.g.
claude-code, cursor).Arbitrary key-value metadata to attach to the session.
201— Session created. Returns{ session: SessionObject }.400— Invalid request body.409— A session with this ID already exists. Returns{ error: "Session already exists", id: "..." }.
List sessions
GET /v1/sessions
Returns a paginated list of sessions for your organization, sorted by startedAt descending (most recent first).
Query parameters
Filter to sessions linked to a specific assessment via candidate keys.
Filter by tool or integration identifier.
Maximum results to return. Clamped to
1–100. Defaults to 20.Results to skip for pagination. Defaults to
0.Get a session
GET /v1/sessions/:id
Returns a single session record.
Response fields
Session UUID.
Organization this session belongs to.
AI tool or integration that generated this session (e.g.
claude-code, cursor, shell).Timestamp of the first event in the session.
Timestamp when the session was closed.
null if still in progress.Timestamp of the most recently ingested event.
Total number of timeline events captured.
Number of architecture decision events captured.
Estimated percentage of work attributed to AI, between
0 and 100. null if not yet computed.Arbitrary metadata. Well-known keys include
assessmentId, candidateName, and repoUrl, which are automatically populated from session start events.200— Returns{ session: SessionObject }.404— Session not found or does not belong to your org.
Update a session
PATCH /v1/sessions/:id
Updates endedAt and/or metadata on an existing session. Replaces (does not merge) the metadata object when provided. To merge metadata instead, use PATCH /v1/sessions/:id/metadata.
Request body
Mark the session as ended at this timestamp.
Replace the session’s metadata with this object.
200— Returns{ session: SessionObject }.400— Invalid body.404— Session not found.
Delete a session
DELETE /v1/sessions/:id
Hard-deletes the session and all associated data: timeline events, raw events, session artifacts, and scores. The candidate key that linked to this session has its sessionId cleared but is not deleted.
Requires reviewer authentication.
Responses
200— Returns{ ok: true, id: "<session-id>" }.404— Session not found.
Get the event timeline
GET /v1/sessions/:id/timeline
Returns the ordered list of timeline events for a session, sorted by ts ascending then by insertion order for events with the same timestamp.
Query parameters
Maximum events to return. Clamped to
1–2000. Defaults to 500.Cursor for pagination. Pass the
id of the last event you received to fetch the next page.id of the final event in each response as the after cursor in the next request.
Get decisions
GET /v1/sessions/:id/decisions
Returns all decision_event timeline entries for a session, ordered by ts ascending. These are architecture and tradeoff decisions captured by the Promptster MCP server or CLI during the candidate’s session.
Response
200— Returns{ decisions: [...] }. Returns an empty array if no decisions were captured.404— Session not found.
Get cohort statistics
GET /v1/sessions/:id/cohort-stats
Returns aggregate metrics for the assessment this session belongs to, along with percentile ranks for this session relative to the cohort. The cohort includes all sessions with candidate key status completed, expired, or hired.
Percentiles are only computed when the cohort has at least two sessions. Returns { cohortStats: null } if the session is not linked to an assessment or the cohort has no completed sessions.
Response
0.0 and 1.0. Higher values indicate better relative performance. For commandFailRate, a lower raw value means better performance — the percentile is ranked accordingly.