Append one decision, handoff, checkpoint or note to a program.
Append-only: there is no update and no delete. A later record supersedes an earlier one by being later. The author is derived from the authenticating principal - a session or user token records as a human, an OAuth agent as an agent, an API key as api_key - and is never read from the body. An optional idempotency key, unique within the program, makes a retry return the record it already wrote. Optional recipients address the record to named sessions or handoff roles (the mailbox between sessions); replyToRecordId threads a reply and supersedesRecordId retires the named record for this record's own readers only: its recipients, or every reader when it is a broadcast. A reader never loses mail to a replacement it cannot see.
AuthorizationBearer <rsk_live_*>Rensei API key presented as Authorization: Bearer rsk_live_. Required API-key scopes are recorded per operation in x-rensei-required-scopes.
programId*string^prog_[0-9a-f]{32}$application/json- body
kind*string"decision""handoff""checkpoint""note"title*string1 <= length <= 512body*string1 <= length <= 65536refs?recipients?array<>1 <= items <= 16replyToRecordId?string^prec_[0-9a-f]{32}$supersedesRecordId?string^prec_[0-9a-f]{32}$idempotencyKey?string1 <= length <= 256An idempotency key replayed the record already written.
application/json- response
ledgerVersion*stringprogramVersion*stringrecord*created*booleancurl -X POST 'https://app.rensei.ai/api/cli/programs/string/records' \ -H 'Content-Type: application/json' \ -d '{ "kind": "decision", "title": "string", "body": "string"}'{ "ledgerVersion": "rensei.session-ledger/v1alpha1", "programVersion": "rensei.session-ledger.program/v1alpha1", "record": { "ledgerVersion": "rensei.session-ledger/v1alpha1", "programVersion": "rensei.session-ledger.program/v1alpha1", "programId": "string", "recordId": "string", "kind": "decision", "title": "string", "body": "string", "refs": { "issues": [ "string" ], "commits": [ "string" ], "sessions": [ "string" ] }, "recipients": [ { "kind": "session", "id": "string" } ], "replyToRecordId": "string", "supersedesRecordId": "string", "author": { "kind": "human", "id": "string" }, "idempotencyKey": "string", "createdAt": "2019-08-24T14:15:22Z" }, "created": true}Read the append-only decision and handoff records for one program.
Keyset-paginated, newest first. Records carry the markdown a coordinator wrote and typed references to the issues, commits and sessions the record concerns. Addressed records (recipients) are the mailbox between sessions; addressedOnly (true/false or 1/0) narrows to them, and unreadOnlyFor to the unread mail of one reader: broadcasts plus records addressed to that reader or to one of its comma-separated roles, never mail addressed to another reader. Visibility matches the program itself: an invisible program is reported as not found rather than forbidden.
Read the current resumable topology for one program ledger.
One authoritative read joins the immutable program event stream to current session-ledger edges and nodes, and inlines the most recent program records so a cold session needs one call rather than three. Terminal children are absent even when no later program event was appended. mailbox counts one reader's unread mail (broadcasts plus records addressed to it or to one of the comma-separated roles it claims): the authenticated principal by default, or readerSessionId when named. It is null when no reader can be attributed.