Browse the extensions reference

Update Agent

post/extensions/roboledger/{graph_id}/operations/update-agent

Part of RoboLedger: Ledger & Events.

Patch counterparty fields. Only supplied fields are updated. Set is_active=false to deactivate (agents are never deleted — they are reference data referenced by events and transactions). classification_element_id sets the account this counterparty's bank lines are suggested (an empty string clears it), and classification_mode='always_ask' stops suggesting one for a counterparty whose lines go to different accounts; its still-open lines are re-suggested at once. Each entity of a group keeps its own default, on its own chart: classification_entity_id names the one these fields are for, omitted the group parent. A default is also learned as lines are committed, so set one by hand only to correct 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
agent_idrequiredstring

The agent to update.

nameoptionalstring
legal_nameoptionalstring
tax_idoptionalstring
registration_numberoptionalstring
dunsoptionalstring
leioptionalstring
emailoptionalstring
phoneoptionalstring
addressoptionalobject
is_activeoptionalboolean

Toggle activation. Inactive agents are hidden from new-transaction pickers.

is_1099_recipientoptionalboolean
classification_element_idoptionalstring

The chart account this counterparty's bank lines are usually classified to, suggested on each new line. An empty string clears it. Its still-open lines are re-suggested at once. Omit to keep.

classification_modeoptionalstring

suggest offers the default on each line; always_ask offers none, for a counterparty whose lines go to different accounts. Omit to keep.

One of: suggest, always_ask

classification_entity_idoptionalstring

The entity whose bank lines the default above is for. Each entity keeps its own default, on its own chart. Omit for the group parent.

metadata_patchoptionalobject

Deep-merged into agent.metadata. Pass {} to leave unchanged. The default classification is set with the fields above, not here.

Example request

curl · example 1 of 2
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-agent" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": "agt_01HVF8T0M2YTAY3BBNRH0V0",
  "is_1099_recipient": true,
  "tax_id": "12-3456789"
}'
curl · example 2 of 2
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-agent" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": "agt_01HVF8T0M2YTAY3BBNRH0V0",
  "is_active": 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

resultoptionalLedgerAgentResponse

Command-specific result payload

LedgerAgentResponse fields
FieldTypeDescription
idrequiredstring
agent_typerequiredstring
namerequiredstring
legal_nameoptionalstring
tax_idoptionalstring
registration_numberoptionalstring
dunsoptionalstring
leioptionalstring
emailoptionalstring
phoneoptionalstring
addressoptionalobject
sourcerequiredstring
external_idoptionalstring
is_activerequiredboolean
is_1099_recipientrequiredboolean
classificationoptionalAgentClassification

The default account the group parent's bank lines are suggested.

AgentClassification fields
FieldTypeDescription
entity_idrequiredstring

The entity whose lines it is for.

element_idrequiredstring

The default chart account.

account_nameoptionalstring

The account's name.

moderequiredstring

suggest: offered on each new line. always_ask: never offered.

confirmationsrequiredinteger

Committed lines that went to this account.

overridesrequiredinteger

Committed lines that went elsewhere while it was the default.

set_byoptionalstring

Who set or last moved it.

set_atoptionalstring

When it was set or last moved.

learned_fromoptionalstring

The committed line it was learned from, when it was.

classificationsoptionalAgentClassification[]

The default account for each entity's bank lines, one per entity.

AgentClassification fields
FieldTypeDescription
entity_idrequiredstring

The entity whose lines it is for.

element_idrequiredstring

The default chart account.

account_nameoptionalstring

The account's name.

moderequiredstring

suggest: offered on each new line. always_ask: never offered.

confirmationsrequiredinteger

Committed lines that went to this account.

overridesrequiredinteger

Committed lines that went elsewhere while it was the default.

set_byoptionalstring

Who set or last moved it.

set_atoptionalstring

When it was set or last moved.

learned_fromoptionalstring

The committed line it was learned from, when it was.

created_atoptionalstring (date-time)
updated_atoptionalstring (date-time)
created_byoptionalstring
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