API reference
Dimensions
The ways the books are sliced, such as department or project.
- GET
/v1/dimensionsList the dimensions the books slice by - POST
/v1/dimensionsAdd a dimension - GET
/v1/dimensions/{dimension_id}Get a dimension - PATCH
/v1/dimensions/{dimension_id}Rename a dimension - DELETE
/v1/dimensions/{dimension_id}Delete a dimension no posted line names
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
| Name | Type | Description |
|---|---|---|
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
Response
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 "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
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 -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
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
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 "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
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
Request body
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 -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
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
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 -X DELETE "https://api.ledgerit.ai/v1/dimensions/{dimension_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
DimensionPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of DimensionOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
NewDimension
| Name | Type | Description |
|---|---|---|
keyRequired | string | Lower-case letters, digits and underscores, e.g. |
nameRequired | string |
DimensionOut
| Name | Type | Description |
|---|---|---|
created_atRequired | string (date-time) | |
idRequired | string | An id that starts with |
keyRequired | string | What an API caller names it by, e.g. |
nameRequired | string | What a person reads, e.g. Department. |
DimensionChanges
| Name | Type | Description |
|---|---|---|
nameRequired | string |