API reference

Dimensions

The ways the books are sliced, such as department or project.

Guides: Read your chart of accounts

List the dimensions the books slice by

GET/v1/dimensions

client.dimensions.list()

Every dimension these books slice by, by key.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200DimensionPage

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/dimensions" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Add a dimension

POST/v1/dimensions· Idempotent

client.dimensions.create()

Add a dimension to slice the books by.

Refused with dimension_conflict when these books already have one with the same key.

Request body

NewDimension

Response

201DimensionOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/dimensions" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"key":"…","name":"…"}'

Get a dimension

GET/v1/dimensions/{dimension_id}

client.dimensions.get()

One dimension.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

Response

200DimensionOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/dimensions/{dimension_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Rename a dimension

PATCH/v1/dimensions/{dimension_id}· Idempotent

client.dimensions.update()

Rename a dimension. Its key never changes.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

Request body

DimensionChanges

Response

200DimensionOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X PATCH "https://api.ledgerit.ai/v1/dimensions/{dimension_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"…"}'

Delete a dimension no posted line names

DELETE/v1/dimensions/{dimension_id}

client.dimensions.delete()

Remove a dimension, its values and every account's requirement of it.

Refused with dimension_in_use once a posted line names it: posted lines keep their dimensions.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

Response

204No content

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X DELETE "https://api.ledgerit.ai/v1/dimensions/{dimension_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

DimensionPage

NameTypeDescription
dataRequiredarray of DimensionOut
has_moreRequiredboolean
next_cursorRequiredstring or null

NewDimension

NameTypeDescription
keyRequiredstring

Lower-case letters, digits and underscores, e.g. department.

nameRequiredstring

DimensionOut

NameTypeDescription
created_atRequiredstring (date-time)
idRequiredstring

An id that starts with dim_.

keyRequiredstring

What an API caller names it by, e.g. department. Never changes.

nameRequiredstring

What a person reads, e.g. Department.

DimensionChanges

NameTypeDescription
nameRequiredstring