Publish Record
engramic_record_publishPublish a previously-staged event draft. Pass 2 of the two-pass record flow.
The draftId comes from a prior engramic_record_draft call. After publish the event is permanent, visible to the timeline, and the draft row is deleted.
EDITS (PATCH-style, all optional):
Any subset of the original record fields can be supplied to override the drafted value (e.g. update detail, add references, replace topics).
Omitted fields keep the drafted value.
Arrays REPLACE the drafted array wholesale (no append).
'type' and 'actorId' are IMMUTABLE — to change them, abandon this draft (engramic_record_abandon) and stage a new one.
AUTHORIZATION: Only the operator that staged the draft can publish it (not the attributed identity); the same operator may have several drafts waiting and publishes each by its draftId. A different operator publishing returns FORBIDDEN_NOT_DRAFT_OWNER.
OUTPUT: the saved record, including url (a link to it in the app) and client (the app it was recorded through, when known).
ERROR CODES:
DRAFT_NOT_FOUND — draftId unknown or expired (4-hour TTL, silently dropped)
FORBIDDEN_NOT_DRAFT_OWNER — publishing operator ≠ the operator that staged the draft
IMMUTABLE_FIELD — edits tried to change type or actorId
VALIDATION_ERROR — merged payload failed validation (dueAt on a record that is not an action, for one); draft stays alive
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | No | PATCH-style edits applied to the drafted payload before publish | |
| draftId | Yes | The ed_… id returned by engramic_record_draft |