API reference
Comments
Notes on a transaction for everyone in the books, which can mention members and be resolved.
- GET
/v1/commentsList comments on records - POST
/v1/commentsComment on a record - PATCH
/v1/comments/{comment_id}Change a comment, or mark it settled - DELETE
/v1/comments/{comment_id}Delete a comment you wrote
Guides: Review and file transactions
Comment on a record
POST/v1/comments· Idempotent
client.comments.create()
Comment on a record. The members it mentions are told.
With proposed_account_id, the comment proposes the GL account a
transaction belongs in: for a member, who cannot post, to say where
something goes. The account is held to what filing would take, the
people who may post are told, and the proposal leads the transaction's
suggestions until the comment is resolved. Nothing is filed.
Request body
Response
201CommentOut
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/comments" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"about":"transaction","body":"…","subject_id":"…"}'Change a comment, or mark it settled
PATCH/v1/comments/{comment_id}· Idempotent
client.comments.update()
Change a comment's words (its author only), or mark the matter settled or open again (anyone who may write).
Parameters
| Name | Type | Description |
|---|---|---|
comment_idPath · Required | string | An id that starts with |
Request body
Response
200CommentOut
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/comments/{comment_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'Delete a comment you wrote
DELETE/v1/comments/{comment_id}
client.comments.delete()
Delete a comment you wrote.
Parameters
| Name | Type | Description |
|---|---|---|
comment_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/comments/{comment_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
CommentPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of CommentOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
NewComment
| Name | Type | Description |
|---|---|---|
aboutRequired | string | One of transaction, journal_entry |
bodyRequired | string | |
mentions | array of string | Members to tell, by user id. |
proposed_account_id | string or null | An id that starts with |
subject_idRequired | string | An id. Which resource it names is given by the field beside it. |
CommentOut
| Name | Type | Description |
|---|---|---|
aboutRequired | string | What it is on: |
author_emailRequired | string or null | |
author_idRequired | string or null | An id that starts with |
bodyRequired | string | |
created_atRequired | string (date-time) | |
edited_atRequired | string (date-time) or null | |
idRequired | string | An id that starts with |
mentionsRequired | array of string | The members it names; each was told. |
proposed_account_code | string or null | That account's code. |
proposed_account_id | string or null | An id that starts with |
proposed_account_name | string or null | That account's name. |
resolved_atRequired | string (date-time) or null | When someone marked the matter settled. |
subject_idRequired | string | The record's id: a transaction's or a journal entry's. |
CommentChange
| Name | Type | Description |
|---|---|---|
body | string or null | New words; the author only. |
resolved | boolean or null | Mark the matter settled, or open it again. |
List comments on records
GET
/v1/commentsclient.comments.list()
Comments, oldest first: one record's discussion, or every one in the books.
Parameters
aboutQueryWhat the comments are on.
transaction,journal_entryDefault transactionsubject_idQueryAn id. Which resource it names is given by the field beside it.
limitQueryPage size, 1–200.
cursorQueryThe
next_cursorof the previous page.Response
200CommentPage
Errors
Example