Update Event Block
/extensions/roboledger/{graph_id}/operations/update-event-blockPart of RoboLedger: Ledger & Events.
Apply a status transition (captured → classified | committed | voided) and/or field corrections (description, effective_at, metadata_patch) to an existing event block. Only supplied fields are updated. captured → classified records an account choice without posting — for a bank-feed line, patch metadata.classified_element_id (or accept_suggestion: true) in the same call. When the transition is captured/classified → committed, the registered Python handler (else the matching event handler's template) fires against the captured metadata to produce the GL rows, unless it already wrote them when the event was created; an event with a handler cannot skip to pending or fulfilled without rows. A bank-feed line with no account chosen and no matching rule is refused. Errors from the handler (validation, element resolution, closed period, unbalanced lines) surface as 422 here so the inbox UI can display the failure reason without retry. A bank line's flow is a second classification beside its account, overriding the account's default flow on the cash flow and equity statements: patch classified_flow_qname (or flow_qname on each classified_allocations part) with an rs-gaap flow concept such as rs-gaap:ProceedsFromIssuanceOfLongTermDebt. On a line that has already posted, this re-tags its lines in place, in a closed month too, since no balance moves; an empty string clears it. A payment or bank line records the invoices or bills it settles with discharge_allocations (positive cents per document, together at most its amount) or one discharges_event_id; each is checked: an invoice for money in, a bill for money out, on its own entity, not voided.
Idempotency: supply an Idempotency-Key header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
Authentication
Authenticate in any one of these ways — not all of them:
- API key in the
X-API-Keyheader. - Bearer token in the
Authorizationheader.
Path parameters
| Name | Type | Description |
|---|---|---|
graph_idrequired | string | Graph Id Constraints: matches |
Header parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Keyoptional | string | Idempotency-Key |
Request body
Required, application/json.
| Field | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
event_idrequired | string | Target event ID. | |||||||||
transition_tooptional | string | Status transition. Valid moves depend on current status: captured → classified | committed | voided | superseded; classified → committed | pending | fulfilled | voided | superseded; committed → pending | fulfilled | voided | superseded; pending → fulfilled | voided | superseded; fulfilled → voided | superseded. A retraction (voided, superseded) is final and is refused from any status once the event's ledger rows have posted or it has published to QuickBooks — reverse the posted entries instead. captured → classified records an account choice without posting (bank-feed lines: patch classified_element_id, or accept_suggestion: true, in the same call); the later commit fires the handler. Note: classified and fulfilled are otherwise set by handlers, not by callers, but the transition is allowed for corrections. One of: | |||||||||
superseded_by_idoptional | string | New event id that replaces this one. Required when transition_to='superseded'. | |||||||||
descriptionoptional | string | Replacement free-text summary. Unset = unchanged; pass an empty string to clear. | |||||||||
effective_atoptional | string (date-time) | New accounting recognition date. Unset = unchanged. Useful when an event was captured against the wrong period. | |||||||||
due_dateoptional | string (date) | New due date of an obligation (an | |||||||||
metadata_patchoptional | object | Key-value pairs merged into existing metadata (additive patch, not replace). | |||||||||
event_actionoptional | string | Set or correct the canonical action verb. Unset = unchanged. Useful when an adapter improvement makes a previously-NULL verb fillable, or when reclassifying after the fact. One of: | |||||||||
obligated_by_event_idoptional | string | Set/update the forward-materialization link. | |||||||||
discharges_event_idoptional | string | Set the settlement link: the one invoice or bill this payment settles, at its full amount; an empty string clears it. Replaces any | |||||||||
discharge_allocationsoptional | DischargeAllocation[] | What this payment settles, document by document: one row per invoice or bill with the positive cents applied to it, together at most the payment's amount (the rest is unapplied). Replaces any held; an empty list clears them, and the settlement link becomes the first row's. Each must be an obligation of this event's entity, not voided: an invoice for money in, a bill for money out. A person chooses them; the open items a bank line may settle are DischargeAllocation fields
| |||||||||
document_idoptional | string | Set or replace the stored document the event rests on; an empty string detaches it. Must be a document on this graph. Unset = unchanged. |
Example request
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-event-block" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_abc123",
"transition_to": "committed"
}'curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-event-block" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"description": "Reviewed and approved by controller",
"effective_at": "2026-04-30T23:59:59Z",
"event_id": "evt_abc123",
"metadata_patch": {
"review_note": "Recognized in April per terms",
"reviewed_by": "usr_controller_jane"
}
}'curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-event-block" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_oldwrong",
"superseded_by_id": "evt_newcorrect",
"transition_to": "superseded"
}'Responses
200 Successful Response
| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationrequired | string | Kebab-case operation name | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operationIdrequired | string | op_-prefixed ULID for audit and SSE correlation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statusrequired | string | Operation lifecycle state One of: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resultoptional | EventBlockEnvelope | Command-specific result payload EventBlockEnvelope fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
atrequired | string | ISO-8601 UTC timestamp | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdByoptional | string | User ID that initiated the operation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
idempotentReplayoptional | boolean | True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions. Default: |
| Status | Meaning |
|---|---|
| 400 | Invalid request |
| 401 | Authentication required |
| 403 | Access denied |
| 404 | Resource not found |
| 409 | Idempotency-Key conflict — key reused with different body |
| 422 | Validation error |
| 429 | Rate limit exceeded |
| 500 | Internal server error |