API reference
Dimension values
The values a dimension takes, such as Engineering under Department.
- GET
/v1/dimensions/{dimension_id}/valuesList a dimension's values - POST
/v1/dimensions/{dimension_id}/valuesAdd a value to a dimension - GET
/v1/dimensions/{dimension_id}/values/{value_id}Get a dimension value - PATCH
/v1/dimensions/{dimension_id}/values/{value_id}Rename a dimension value or move it under another - DELETE
/v1/dimensions/{dimension_id}/values/{value_id}Delete a dimension value no posted line carries
Guides: Read your chart of accounts
List a dimension's values
GET/v1/dimensions/{dimension_id}/values
client.dimensionValues.list()
A dimension's values, by code.
Parameters
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
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/{dimension_id}/values" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Add a value to a dimension
POST/v1/dimensions/{dimension_id}/values· Idempotent
client.dimensionValues.create()
Add a value to a dimension.
Refused with dimension_conflict when the dimension already has one with
the same code, and dimension_invalid when the parent is not of it.
Parameters
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
Request body
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 -X POST "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"code":"…","name":"…"}'Get a dimension value
GET/v1/dimensions/{dimension_id}/values/{value_id}
client.dimensionValues.get()
One value of a dimension.
Parameters
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
value_idPath · Required | string | An id that starts with |
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/{dimension_id}/values/{value_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Rename a dimension value or move it under another
PATCH/v1/dimensions/{dimension_id}/values/{value_id}· Idempotent
client.dimensionValues.update()
Rename a value or move it under another. Its code never changes.
Refused with dimension_invalid when the new parent is not of the same
dimension, or is the value itself or one under it.
Parameters
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
value_idPath · Required | string | An id that starts with |
Request body
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 -X PATCH "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values/{value_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'Delete a dimension value no posted line carries
DELETE/v1/dimensions/{dimension_id}/values/{value_id}
client.dimensionValues.delete()
Remove a value. Values under it move to the top.
Refused with dimension_in_use once a posted line carries it.
Parameters
| Name | Type | Description |
|---|---|---|
dimension_idPath · Required | string | An id that starts with |
value_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}/values/{value_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
DimensionValuePage
| Name | Type | Description |
|---|---|---|
dataRequired | array of DimensionValueOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
NewDimensionValue
| Name | Type | Description |
|---|---|---|
codeRequired | string | |
nameRequired | string | |
parent_id | string or null | An id that starts with |
DimensionValueOut
| Name | Type | Description |
|---|---|---|
codeRequired | string | Unique within the dimension, e.g. ENG. Never changes. |
created_atRequired | string (date-time) | |
dimension_idRequired | string | An id that starts with |
idRequired | string | An id that starts with |
nameRequired | string | What a person reads, e.g. Engineering. |
parent_idRequired | string or null | An id that starts with |
DimensionValueChanges
Only the fields sent change; parent_id: null moves it to the top.
| Name | Type | Description |
|---|---|---|
name | string | |
parent_id | string or null | An id that starts with |