Browse the extensions reference

Create Dimension

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

Part of RoboLedger: Ledger & Events.

Add a member to a management dimension: a department, class, location or project (or an axis of your own) that ledger lines can carry, one member per axis per line. value is the member's stable key within its axis, a slug of the name when omitted; a second member with the same key returns 409. Tag lines with its id through dimension_ids on a journal line, and read the income statement by it with live-financial-statement's dimension.

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
dimension_typerequiredstring

The axis: department, class, location or project, or any other lowercase name, which starts an axis of its own. scenario is reserved for forecasts.

Constraints: matches ^[a-z][a-z0-9_]{0,39}$

namerequiredstring

The member's label.

Constraints: 1–200 characters

valueoptionalstring

The member's stable key within the axis; omitted, a slug of the name. Refused (409) when the axis already has it.

Constraints: 1–200 characters

Example request

curl
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/create-dimension" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "dimension_type": "string",
  "name": "string"
}'

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

resultoptionalDimensionResponse

Command-specific result payload

DimensionResponse fields
FieldTypeDescription
idrequiredstring

The member's id, as lines carry it.

dimension_typerequiredstring

The axis: department, class, location, project, or another.

namerequiredstring

The member's label.

valuerequiredstring

The member's stable key within its axis: the source's id for a synced member, a slug of the name for one created here.

sourceoptionalstring

Where the member came from: native or quickbooks.

Default: native

is_activerequiredboolean

False once retired: the member stays on the lines that carry it and can no longer be put on new ones.

line_countoptionalinteger

How many ledger lines carry the member.

Default: 0

created_atoptionalstring (date-time)

When it was created.

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