Browse the extensions reference

Learn Classification Defaults

post/extensions/roboledger/{graph_id}/operations/learn-classification-defaults

Part of RoboLedger: Ledger & Events.

Seed each counterparty's default account from the bank lines already committed to the books: the account most of its lines went to becomes its default, with the lines that agreed counted as confirmations. A counterparty that already has a default keeps it. Its still-open lines are then suggested from the default. Run it once on books that were classified before defaults were learned; after that, every commit teaches the default by itself. dry_run reports what would be learned without writing it.

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

Constraints: matches ^(kg[a-f0-9]{16,}(?:_[a-zA-Z0-9]{1,20})?|sec(?:_[a-zA-Z0-9]{1,20})?|library)$

Header parameters

NameTypeDescription
Idempotency-KeyoptionalstringIdempotency-Key

Request body

Required, application/json.

FieldTypeDescription
dry_runoptionalboolean

Report what would be learned without writing it.

Default: false

Example request

curl
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/learn-classification-defaults" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "dry_run": false
}'

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

resultoptionalLearnClassificationDefaultsResponse

Command-specific result payload

LearnClassificationDefaultsResponse fields
FieldTypeDescription
agents_learnedrequiredinteger

Counterparties given a default from their committed lines.

agents_keptrequiredinteger

Counterparties that already had a default, left as they were.

lines_readrequiredinteger

Committed lines classified to a single account that were read.

open_lines_resuggestedrequiredinteger

Still-open lines whose suggestion changed as a result.

dry_runrequiredboolean
atrequiredstring

ISO-8601 UTC timestamp

createdByoptionalstring

User ID that initiated the operation

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