Browse the API reference

Create Agent

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

Part of Extensions: RoboLedger.

Create a counterparty record (customer, vendor, employee, etc.). The (source, external_id) pair is a dedup key — a second insert with the same pair returns 409. Use update-agent to patch fields.

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
agent_typerequiredstring

Relationship category: 'customer' | 'vendor' | 'employee' | 'owner' | 'supplier' | 'government' | 'lender' | 'self' | 'other'.

namerequiredstring

Display name shown in lists and on transactions.

legal_nameoptionalstring

Full registered legal name (when different from `name`).

tax_idoptionalstring

Tax ID (EIN / SSN / VAT). Used for 1099 / withholding reporting.

registration_numberoptionalstring

Registry-issued company number (e.g. state corp file number).

dunsoptionalstring

Dun & Bradstreet DUNS number.

leioptionalstring

Legal Entity Identifier (ISO 17442).

emailoptionalstring
phoneoptionalstring
addressoptionalobject

Free-form address object (e.g. {"line1": "...", "city": "...", "state": "...", "postal_code": "..."}).

sourceoptionalstring

Provenance: 'native' (created in-app), 'quickbooks' / 'xero' / 'plaid' (synced from integration). Drives reconciliation behavior.

Default: native

external_idoptionalstring

Source system primary key — used to match on subsequent syncs.

is_activeoptionalboolean

Inactive agents stay in history but can't be picked for new txns.

Default: true

is_1099_recipientoptionalboolean

Marks a vendor as 1099-eligible. Drives year-end 1099 reporting.

Default: false

metadataoptionalobject

Example request

curl
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/create-agent" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_type": "vendor",
  "is_1099_recipient": true,
  "name": "Acme Office Supplies",
  "tax_id": "12-3456789"
}'

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