v2-agent-state function, just running on your Supabase project. Point a client at your own base URL and everything below behaves identically.
This is a replication API — it stores and serves encrypted snapshots and replication blocks. It is not a memory-extraction API. There are no
/memories routes, no message-array ingestion, and no server-side search: embedding and semantic recall happen entirely on-device. See store_memory for where that actually lives.Base URL
v2-agent-state function-name prefix and an optional /v2 prefix, so /snapshot and /v2/snapshot are equivalent. Older clients that send the /v2 form continue to work.
Authentication
Every route below requires a bearer token. There is noAUTH_DISABLED mode.
Replication routes
These are the routes the SDKs use. All are API-key authenticated and subject to the trial gate.Write a snapshot
POST /snapshot
Restore
GET /snapshot/:agent_id/latest— most recent snapshot for an agentGET /snapshot/:agent_id/:sequence— a specific point in historyGET /snapshot/:agent_id/lineage?limit=100— the parent chain (default limit100)
Differential replication
POST /replicate— push encrypted replication blocksGET /head— latest confirmed sequence number and Merkle rootGET /replay?since=N— stream replication log from a sequence number
Layer-A reads (server-blind metadata)
GET /metadata— usage aggregates: envelope counts, byte totals, device countGET /envelopes— paginated ciphertext envelope list
Dashboard and account routes
These exist on the same function but are authenticated by session JWT, not API key. They are used by the dashboard rather than the SDKs.Team and enterprise routes
Cron and lifecycle routes
Authenticated by a cron secret, not a user token:POST /retention/purge— daily retention sweepPOST /lifecycle/dispatch— lifecycle email sweepPOST /invitations/accept— accept an invitation (unauthenticated or session-authed)POST /marketing/capture,POST /marketing/unsubscribe— marketing capture and unsubscribe
Errors
Unmatched paths return:{ "error": "<code>", ...details } with the appropriate HTTP status. See Errors for the full code reference.