Skip to main content

Sessions and Archive

Source-reviewed API reference

This reference was reconciled against current development source on 2026-11-08. Historical public-source links below remain pinned to their stated revision; they are not proof that a public mirror or your installation has caught up. Start with the current operator guide for installation. This is static source review, not a live API compatibility test.

A session's canonical conversation evidence is in PostgreSQL. The current prompt tail, human-facing transcript, original export, trace proof and reset/archive snapshots are distinct views. See conversation history before choosing an export or deleting data.

Discovery and transcript operations​

GET /api/sessions supports agentId, archived=true, q, updatedSince and limit. Without agentId, it aggregates enabled agents, sorts by update time and applies the overall limit. Archived sessions are excluded by default here; Archive list defaults differ.

For /api/sessions/{sessionId} and its actions, pass agentId in the query. Read detail for the UI projection. /export returns the normalized canonical transcript for the active reset generation; /export?format=raw returns retained stored JSON evidence across active entries and archives, including reset archives. Mutation bodies include:

ActionRelevant body / effect
resetCaptures a boundary handoff, snapshots the prior conversation and clears active entries; not erasure
rename{ "targetSessionId": "new-name" }
archiveOptional archived; false unarchives, otherwise marks archived and can request a summary
unarchiveClears the archive flag
forkOptional targetSessionId, otherwise <source>-fork; separate copy/provenance, not a live branch

Reset and archive retain original evidence. Current reset captures a handoff, blocks new admissions during the boundary change, supersedes active session runs, and resets the stored conversation. Current cancellation propagates into PostgreSQL work, with rollback/drain before client release and generation fencing against late writes; do not interpret a cancellation acknowledgement as immediate quiescence. The response can include supersededRuns; Archive summary generation is queued separately, so reset success is not a summary-completion receipt. Historical public 2026.10.19 predates this reset coordination. The former Albdruck purge endpoint is retired. The current retention preview/run controls manage traces, not individual conversation purge; see retention and deletion. Do not conflate hiding a session with deleting retained content.

Creating a session and exporting evidence​

POST /api/sessions accepts JSON { "agentId": "agent-id", "sessionId": "new-session", "operationId": "client-operation-id" }. The session and operation IDs must be nonblank. The response is { ok: true, agentId, sessionId, operationId }. Retain the same payload when retrying an uncertain create: the same target and creation operation replay successfully without clearing subsequently written messages. An existing target with a different operation returns 409 session_target_exists. This creation replay contract is separate from reset's outcome-only operation ID below.

GET /api/sessions/{sessionId}/export?agentId=... reconstructs the active-generation transcript with compacted predecessors, deduplicating overlap. Add format=raw for burrow-session-raw-evidence/v1: occurrences preserve each stored occurrence's sourceKind, sourceId, textual ordinal and rawJson. That raw view includes retained reset archives and does not deduplicate occurrences or parse their payloads into normalized entries. It preserves stored JSON text, not original transport bytes. It can return an empty occurrence list, so do not use it alone to prove that a session exists.

Fork is also not a full evidence export: the HTTP route uses the store's default tail of at most 200 active entries and returns copiedEntries. It does not clone the source's complete archive history.

Context, search and continuity​

/api/session/context and /api/context inspect context; /api/session/context-status includes current limits and live usage where available. Defaults use session default. These responses may expose private conversational material.

Session search accepts q, role, limit (default 50), sourceId, since, until, agentId, sessionId, scope and archived. Scope defaults to session when an agent/session/source selector is present, otherwise burrow. Explicit scope=session targets one selected session; broader search gathers enabled-agent evidence and includes archives unless archived=false.

Latest-request context status​

GET /api/session/context-status returns { ok: true, status }. status.context includes estimatedTokens, capacityTokens, usageRatio, percent, pressure and source. Its scope distinguishes latest-request, legacy historical evidence and reconstructed estimates.

For a correlated request, estimatedTokens uses its matching providerInputTokens when reported, otherwise the request estimate. requestEstimatedTokens preserves that original estimate. A smaller continuation replaces the previous run peak; this projection does not relax preparation budgets.

Optional nullable evidence includes local physical requestId, runId, modelCall, lastTurnAt, stage (request-estimate or response), provider, providerName, actual serving connectionId, pool logicalConnectionId, requested model, returned responseModel/responseId, responseStatus and responseOk. New requests clear prior response evidence. Missing returned-model data stays unknown rather than copying the requested model. Pressure is a budget-ratio classification, not dispatch, acceptance or execution status.

status.compaction contains active, next, last and newest-first history capped at 10 records. An actual persisted compression summary invalidates predecessor-context measurements; reconstructed usage remains an estimate until successor evidence arrives. A no-op compression does not invalidate current usage.

Agent recall is a separate tool contract​

The explicit session_search agent tool searches only its current agent's historical sessions, including reset snapshots. It is not equivalent to passing scope=agent_sessions to the operator HTTP route: any non-session HTTP scope takes the broader enabled-agent search branch. Use explicit scope=session, agentId and sessionId when an operator query must stay within one session.

Tool results include source references, dates and neighboring dialogue. The tool supports since, until, sourceId, sourceSessionId, neighborCount and limit. To expand an original, pass the returned sourceRef.entryId as sourceId with its session ID as sourceSessionId; the result then includes original. Default tool result limit is 12; neighbor radius defaults to one and is capped at three. Original source content remains distinct from a handoff or compression recap.

No historical search is automatically run before a turn: the compatibility recall helper reports automatic_recall_disabled, and the support builder supplies no automatic session recall. Ask the agent to retrieve previous discussion explicitly, or use Archive/session search yourself. Continuity scope is an operator-selected namespace. GET/DELETE use query fields; PUT accepts agent/session plus continuityScope (or scope). It is not a path, cwd or execution-target selector. Handoff and handoff-candidate endpoints persist continuity evidence; they do not grant authority to change agent identity.

Reset outcome reconciliation​

POST /api/sessions/{sessionId}/reset accepts optional JSON { "operationId": "client-chosen-operation-id" }. Core records that nonempty string atomically as session.metadata.resetOperationId together with resetGeneration. Read the same agent/session with GET /api/sessions/{sessionId}?agentId=... after a lost response. This is an outcome receipt, not an idempotency key: repeating the POST can reset again.

The current UI allows 120 seconds for reset instead of the ordinary 30-second JSON request budget. After a transport/server failure, it performs a read-only check for the exact operation ID, positive safe-integer reset generation and empty turns on the same session. If that cannot prove success, it preserves the conversation/composer and asks for a refresh before trying again. Most explicit 4xx rejections are returned directly; 408 is treated as an uncertain outcome. A timeout alone proves neither failure nor rollback.

Archive pagination​

SurfaceUseful selectors
/api/archive/calendarkind, month, timezone, agentId
/api/archive/sessionsarchived (default included), q, agentId, date, timezone, limit (default 200), cursor
Session detaillimit (default 100), before, from, to
/api/archive/runsagentId, sessionId, query, limit (default 100), cursor
/api/archive/dreamsagentId, date, timezone, phase, limit (default 200), cursor
/api/archive/continuity/cardsagentId, scope, limit (default 200), cursor

Use server-returned cursors and completeness/continuation information. A visible page or “copy loaded” UI action is not necessarily a full-history export. Calendar grouping uses the requested timezone. Invalid calendar/date/timezone/cursor arguments return a 400-class error.

On builds with canonical Archive run summaries, run list and detail return the same additive execution and toolHistory fields for the selected occurrence. Read execution.status, reasonCode, reason, and source instead of inferring execution from the compatibility status field. The states are running, completed, failed, cancelled, interrupted, superseded, and not_recorded. A running state requires recorded active continuity for that exact run, not just an absent completion.

toolHistory reports total, completed, failed, pending, and unknown. Missing or uncorrelated results are not proof of failure; a result that was never recorded is not proof of ongoing execution. Verification remains a separate record. Read the selected run's detail for evidence rather than expecting raw tool output or the full response in the list.

Authority endpoints return execution explanations, not a new permission grant. Archive proof success, child completion, verification and final delivery are separate pieces of evidence. See Archive UI

Endpoint inventory​

Methods are significant. Braced segments are placeholders; URL-encode identifiers. See the contract and conventions for artifact limitations.

MethodPathPurpose
GET/api/sessionsList sessions for incremental export discovery
POST/api/sessionsCreate an empty session with a replayable creation operation
GET/api/sessions/{sessionId}Read one session
POST/api/sessions/{sessionId}/resetReset a session
GET/api/session/continuity-scopeRead continuity scope
PUT/api/session/continuity-scopeSet continuity scope
DELETE/api/session/continuity-scopeClear continuity scope
GET/api/session/handoffRead session handoff
POST/api/session/handoffWrite session handoff
POST/api/session/handoff-candidateWrite a handoff candidate
GET/api/archive/sessionsList human-facing archived sessions and reset snapshots
GET/api/archive/sessions/{agentId}/{sessionId}Read a human-facing archived session or reset snapshot
POST/api/sessions/{sessionId}/renameRename a session
POST/api/sessions/{sessionId}/archiveArchive a session
POST/api/sessions/{sessionId}/unarchiveUnarchive a session
POST/api/sessions/{sessionId}/forkFork a session
GET/api/sessions/{sessionId}/authorityList session authority explanations
GET/api/sessions/{sessionId}/authority/latestRead latest session authority explanation
GET/api/session/contextInspect session context
GET/api/contextInspect session context alias
GET/api/session/context-statusRead context status
GET/api/session/searchSearch session entries
GET/api/archive/dreamsList archive-ready Dream cards
GET/api/archive/dreams/{agentId}/{entryId}Read an archive-ready Dream document
GET/api/archive/continuity/cardsList current warm continuity cards for Archive inspection
GET/api/archive/continuity/cards/{agentId}/{cardId}Read a current continuity card and its Signal history
GET/api/archive/runsList archived runtime proof packets
GET/api/archive/runs/{runId}Read one archived runtime proof packet
GET/api/sessions/{sessionId}/exportExport normalized transcript, or stored occurrence evidence with format=raw
GET/api/archive/calendarList retained Archive days in the requested timezone

Targeted source review​

The full page was reconciled on 2026-11-08 against Backend commit 6b682eae6cd0dc6efa79e173b7d819fb219443b3. No live API or provider calls were performed. The links below are retained historical public references, not links to the current development source.

28 October development delta​

Changed behavior above was checked statically against Backend a04acb16b0eab2a910c3ef0fb452622df81a05cb on 2026-10-28. This is not a live provider, database or collector test, nor a revalidation of unchanged historical sections. See source coverage.

Current Archive groups and workflow events​

Method/pathContract
GET /api/archive/dreams/groupsOptional q, date, agentId, timezone, limit (default 200, maximum 500), cursor; complete agent/local-day group summaries, including disabled agents and receipt-only days.
GET /api/archive/dreams/groups/:agentId/:daySame timezone as listing; retained diaries, recorded phase attempts and unattributed cycle failures/progress for the selected group.
GET /api/archive/workflow-eventsSame optional list filters; default limit 100, maximum 500. Retained completion snapshots ordered by acceptance createdAt and ID descending.

Dream groups are ordered by day/agent descending. Search covers complete retained narratives and sanitized attempt/error fields, returning the whole matching group. Diary creation and cycle start determine local-day membership; phase timestamps are not inferred from cycle timing. Only an explicit receipt diary ID is a link, and the referenced diary can be outside the group or no longer retained. Legacy individual /api/archive/dreams routes remain available.

Workflow records include watch, repository/workflow, attempt/SHA/conclusion, agent/session, instruction, handling status, chat-run identity, result/error and timing. Returned results are boundary-redacted; ownerId and traceDir are omitted. Retained instruction/error prose still requires review before sharing. These are ordinary authenticated Archive reads, not changes to webhook acceptance or evidence that handling succeeded.

Use a fresh first page after changing filters/timezone. Invalid dates, zones, cursors or limits return the normal 400 errors. Source reviewed against Core bea2171508d1821440ed5c554a688768848699c9 on 30 October 2026.

Current Chat Archive read contract​

Source reviewed on 31 October 2026 against Core 8275b6bedf1fcd969fb5289cf0b673a80ddc8146 and UI f48a29337abccdfeb8c34895d043d6be4110b1fb; no live API or database test was run.

  • Session calendar/date queries include retained visible message occurrence days across live/compacted history and each reset's own generation window, alongside catalog update/reset-creation dates. Unknown occurrence timestamps are not substituted with storage/reset times.
  • Date-selected session rows can return matchedDate in the requested timezone. Respect that authoritative match even when the catalog timestamp differs. Reset cards include proven sourceSessionId and actual reset archivedAt; chatTurnCount can be null when only an inherited tail count was available.
  • GET /api/archive/sessions/{agentId}/{sessionId} reads canonical pages directly from PostgreSQL. limit defaults to 100 and is clamped to 1–500. session.turns is chronological within the newest-first page window. Optional inclusive from/to bounds preserve microseconds; bare dates mean midnight UTC. The UI supplies the selected browser-local day's inclusive bounds on every page, including 23/25-hour DST days.
  • Signed nextCursor values go in before and bind agent/session, the exact raw bounds and retained source revision. Repeat bounds unchanged. A mutation, rewrite, restart or cursor-format upgrade can invalidate paging with 400 archive_cursor_invalid; begin again at the newest page. Do not rely on older append-tolerant cursor or 409-stale behavior for this reader.
  • hasMore, nextCursor and historyStatus: complete describe retained results. A catalog-date match can legitimately have no messages on that date. They do not recover deleted originals or replace canonical full export APIs.
  • Interactive Archive GETs own a 15-second total budget, including queue/pool wait. Disconnect or timeout cancels owned read work; a database statement/lock timeout returns 504 { "ok": false, "error": "archive_query_timeout" }, not an empty collection. Durable runs/jobs are not canceled by page navigation. A failed isolated reader returns 503 archive_reader_unavailable rather than fabricated history.

Chat calendar discovery uses one isolated reader lane; Chat list/detail and Proof share another. Each uses one connection to the same canonical database. A slow calendar therefore does not occupy the foreground lane, but queued reads retain their original deadline. Other Archive collections keep their existing service paths. Large retained transcripts and cold/backfilling discovery can still be expensive; isolation is not a promise of constant-time reads.

Dedicated peer inbox metadata​

Dedicated peer inboxes are created on first implicit contact, not when toggling the preference. Each peer has its own reply lane, continuity family and rotation lifecycle; requests from that same peer stay ordered across source sessions. Labels refresh on later contact after a rename, but the canonical session ID does not change. Existing shared a2a history is retained and remains explicitly addressable; new implicit traffic does not migrate, rename or rotate it. /api/sessions exposes label and a2aPeerAgentId; session detail retains them in metadata.

3 November development delta​

The changed context and host contracts above were checked statically against Backend 32dde3266a231777ddfec6dba141d6b9972a21fd on 2026-11-03. No application, provider or database tests were run; unchanged historical sections retain their earlier qualifications. See source coverage.

Active-session display pagination​

Checked 6 November 2026: GET /api/sessions/{id} accepts limit (default 200) and before for human-facing display. Its session includes hasMore, nextCursor and historyStatus; older pages include compacted predecessors only within the active reset generation and deduplicate overlap. Archive snapshot IDs are not accepted as active sessions. Prompt readers continue to use active context rather than this reconstructed display.

The newest page, current metadata, live chat-input extras and activity are read in one database snapshot. Older display pages do not reconstruct activity or non-prompt inputs. Cursors are snapshot-bound; concurrent changes may return archive_cursor_invalid, requiring a newest-page restart. Retention/deletion still bounds history. See conversation display.

Enforced A2A default-session preference​

Checked 7 November 2026: when the receiving agent disables A2A in default, incoming default routes, including explicit default, trusted default returns and mirrored final replies, go to its canonical per-sender a2a-<sender-id> inbox. Nondefault explicit/attested routes are preserved. Final replies consult the receiver's current preference; no existing messages are moved. See peer routing.

Session rename/fork destination conflicts return HTTP 409 with the specific conflict code and preserve the original sessions. Unexpected storage failures remain server errors, not misleading conflict responses.

15 November 2026 static API reconciliation​

Reviewed this page against Backend 29ca7b6cec378700503a587703adc1d82e9d6f6d and UI 171b19da7ce074fbcb19fa1ed20dfd58e9133cb5, including mounted routes and their relevant stores/UI callers. Corrections above describe implementation, not a live API, database or provider test. Earlier dated receipts remain historical.

Checked 18 November 2026: GET /api/archive/runs accepts optional query to search retained run summaries on the server, including run ID, displayed agent name (or ID when unnamed), objective and status. Matching is case-insensitive literal substring search after trimming the query. It is not a raw-tool-output search. The opaque cursor is bound to the query and agent/session scope; begin a fresh page sequence when those change. The default page size remains 100, capped at 200.

Exact Proof occurrences​

Checked 19 November 2026: GET /api/archive/runs/{runId} accepts sessionId alongside agentId to select an exact occurrence. Use all three recorded identities when following a list entry: the same run ID can appear in different sessions. List ordering and cursors now include session identity. Older run-list cursors do not identify this occurrence boundary and are rejected; restart pagination without the old cursor rather than editing it. Query and agent/session scope still bind each cursor.