API reference

Comments

Notes on a transaction for everyone in the books, which can mention members and be resolved.

Guides: Review and file transactions

List comments on records

GET/v1/comments

client.comments.list()

Comments, oldest first: one record's discussion, or every one in the books.

Parameters

NameTypeDescription
aboutQuerystring

What the comments are on.

One of transaction, journal_entryDefault transaction
subject_idQuerystring or null

An id. Which resource it names is given by the field beside it.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200CommentPage

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/comments" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

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

NewComment

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
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

NameTypeDescription
comment_idPath · Requiredstring

An id that starts with cmt_.

Request body

CommentChange

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
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

NameTypeDescription
comment_idPath · Requiredstring

An id that starts with cmt_.

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/comments/{comment_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

CommentPage

NameTypeDescription
dataRequiredarray of CommentOut
has_moreRequiredboolean
next_cursorRequiredstring or null

NewComment

NameTypeDescription
aboutRequiredstringOne of transaction, journal_entry
bodyRequiredstring
mentionsarray of string

Members to tell, by user id.

proposed_account_idstring or null

An id that starts with gla_.

subject_idRequiredstring

An id. Which resource it names is given by the field beside it.

CommentOut

NameTypeDescription
aboutRequiredstring

What it is on: transaction or journal_entry.

author_emailRequiredstring or null
author_idRequiredstring or null

An id that starts with usr_.

bodyRequiredstring
created_atRequiredstring (date-time)
edited_atRequiredstring (date-time) or null
idRequiredstring

An id that starts with cmt_.

mentionsRequiredarray of string

The members it names; each was told.

proposed_account_codestring or null

That account's code.

proposed_account_idstring or null

An id that starts with gla_.

proposed_account_namestring or null

That account's name.

resolved_atRequiredstring (date-time) or null

When someone marked the matter settled.

subject_idRequiredstring

The record's id: a transaction's or a journal entry's.

CommentChange

NameTypeDescription
bodystring or null

New words; the author only.

resolvedboolean or null

Mark the matter settled, or open it again.