Browse the API reference

Update Journal Entry

post/extensions/roboledger/{graph_id}/operations/update-journal-entry

Part of Extensions: RoboLedger.

Update a draft journal entry. Posted entries are immutable and must be corrected via create-event-block(event_type='journal_entry_reversed'). If line_items is provided, existing line items are replaced atomically, the new set must balance, and a line on a retired (is_active=false) account is refused.

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-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Header parameters

NameTypeDescription
Idempotency-KeyoptionalstringIdempotency-Key

Request body

Required, application/json.

FieldTypeDescription
entry_idrequiredstring

The draft entry to update.

posting_dateoptionalstring (date)

New posting date.

memooptionalstring

New entry-level memo.

typeoptionalstring

New entry type. `closing` should normally only be set by close-period.

One of: standard, adjusting, closing, reversing

line_itemsoptionalJournalEntryLineItemInput[]

Replacement line items. Whole-list replacement (not patch). The new set must still balance (total_debit == total_credit). Omit to leave existing lines untouched.

JournalEntryLineItemInput fields
FieldTypeDescription
element_idrequiredstring

Element ULID identifying the account to post to.

debit_amountoptionalinteger

Debit amount in cents. Must be 0 if `credit_amount` > 0.

Default: 0

credit_amountoptionalinteger

Credit amount in cents. Must be 0 if `debit_amount` > 0.

Default: 0

descriptionoptionalstring

Per-line memo (overrides the entry-level memo on this line).

metadataoptionalobject

Optional per-line metadata stamped on ``LineItem.metadata_``. Used to carry source-system fields the standard columns don't cover — e.g. an external flow-tag code that drives rollforward attribution (``transaction_description_code``), an external memo, or a cost-center hint. Pass-through is non-validating; the renderer / filter engine reads keys it knows about and ignores the rest. ``None`` is normalized to ``{}`` at persist time.

Example request

curl
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-journal-entry" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "entry_id": "ent_01HVF8T0M2YTAY3BBNRH0V0",
  "memo": "Corrected vendor reference"
}'

Responses

200 Successful Response

FieldTypeDescription
operationrequiredstring

Kebab-case operation name

operationIdrequiredstring

op_-prefixed ULID for audit and SSE correlation

statusrequiredstring

Operation lifecycle state

One of: completed, pending, failed

resultoptionalJournalEntryResponse

Command-specific result payload

JournalEntryResponse fields
FieldTypeDescription
idrequiredstring
transaction_idoptionalstring
typerequiredstring
statusrequiredstring
posting_daterequiredstring (date)
memooptionalstring
provenanceoptionalstring
reversal_ofoptionalstring
posted_atoptionalstring (date-time)
line_itemsrequiredJournalEntryLineItemResponse[]

One line in a journal entry response.

JournalEntryLineItemResponse fields
FieldTypeDescription
idrequiredstring
element_idrequiredstring
debit_amountrequiredinteger
credit_amountrequiredinteger
descriptionoptionalstring
line_orderrequiredinteger
total_debitrequiredinteger
total_creditrequiredinteger
atrequiredstring

ISO-8601 UTC timestamp

createdByoptionalstring

User ID that initiated the operation (null for legacy callers)

idempotentReplayoptionalboolean

True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.

Default: false

StatusMeaning
400Invalid request
401Authentication required
403Access denied
404Resource not found
409Idempotency-Key conflict — key reused with different body
422Validation error
429Rate limit exceeded
500Internal server error