API reference
Questions
A question about a transaction asked of one member, and their answer.
- GET
/v1/questionsList questions about records - POST
/v1/questionsAsk a member a question - GET
/v1/questions/{question_id}Get a question and its answer - POST
/v1/questions/{question_id}/answerAnswer a question you were asked - POST
/v1/questions/{question_id}/closeClose a question
Guides: Review and file transactions
List questions about records
GET/v1/questions
client.questions.list()
Questions, newest first: one record's, those waiting on someone, or every one in the books.
Parameters
| Name | Type | Description |
|---|---|---|
aboutQuery | string | What the questions are about. transaction, journal_entryDefault transaction |
subject_idQuery | string or null | An id. Which resource it names is given by the field beside it. |
statusQuery | string or null | Only questions in this state. open, answered, closed |
asked_ofQuery | string or null | Only those asked of this member; |
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
Response
200QuestionPage
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/questions" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Ask a member a question
POST/v1/questions· Idempotent
client.questions.create()
Ask a member a question about a record. They are told, and it waits on their Home until they answer.
The same question is never asked twice: a question about a transaction
no person or rule has decided, that one of the books' rules covers, is
not sent. The rule files it, and the answer is 200 with outcome: filed_by_rule naming the rule. ask_anyway sends it regardless.
Request body
Response
201QuestionOut | FiledByRuleOut
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/questions" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"about":"transaction","asked_of":"…","body":"…","subject_id":"…"}'Get a question and its answer
GET/v1/questions/{question_id}
client.questions.get()
One question, and its answer once there is one.
Parameters
| Name | Type | Description |
|---|---|---|
question_idPath · Required | string | An id that starts with |
Response
200QuestionOut
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/questions/{question_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Answer a question you were asked
POST/v1/questions/{question_id}/answer· Idempotent
client.questions.answer()
Answer a question you were asked. Whoever asked is told.
On a question about a transaction, the answer can also file it: with
account_id the transaction is filed there, as filing it by hand does,
and the question is closed. With rule ("Do this every time") a rule is
written from the answer first — the transaction's counterparty, plus the
memo words and paper given — so the next transaction like it is filed
with no question and no model. The rule's account is checked when it is
written: a header or closed account is refused, nothing is filed, and
the answer is still kept, with filing_refused saying why. Filing needs
books.post.
Parameters
| Name | Type | Description |
|---|---|---|
question_idPath · Required | string | An id that starts with |
Request body
Response
200QuestionOut
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/questions/{question_id}/answer" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"answer":"…"}'Close a question
POST/v1/questions/{question_id}/close· Idempotent
client.questions.close()
Close a question nobody needs any more, answered or not.
Parameters
| Name | Type | Description |
|---|---|---|
question_idPath · Required | string | An id that starts with |
Response
200QuestionOut
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/questions/{question_id}/close" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Objects
The objects these operations take and return.
QuestionPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of QuestionOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
NewQuestion
| Name | Type | Description |
|---|---|---|
aboutRequired | string | One of transaction, journal_entry |
ask_anyway | boolean or null | Send it even when a rule covers the transaction. Without it, a question about a transaction no person or rule has decided, that a rule covers, is not sent: the rule files it. |
asked_ofRequired | string | The member who should answer, by user id. |
bodyRequired | string | |
subject_idRequired | string | An id. Which resource it names is given by the field beside it. |
QuestionOut
| Name | Type | Description |
|---|---|---|
aboutRequired | string | |
answerRequired | string or null | |
answered_atRequired | string (date-time) or null | |
asked_byRequired | string or null | An id that starts with |
asked_by_emailRequired | string or null | |
asked_ofRequired | string or null | An id that starts with |
asked_of_emailRequired | string or null | |
bodyRequired | string | |
closed_atRequired | string (date-time) or null | |
created_atRequired | string (date-time) | |
filing_refused | FilingRefusedOut or null | Only on the answer's own response: why the transaction was not filed, and no rule written, though the answer was kept. The code is the one filing or writing the rule alone is refused with ( |
idRequired | string | An id that starts with |
rule_id | string or null | An id that starts with |
statusRequired | string |
|
subject_idRequired | string | An id. Which resource it names is given by the field beside it. |
FiledByRuleOut
What asking about a transaction a rule already covers answers: it was filed by that rule, and nobody was asked.
| Name | Type | Description |
|---|---|---|
aboutRequired | string | Always |
category_account_idRequired | string | The GL account it was filed to. |
outcomeRequired | filed_by_rule | Always |
rule_idRequired | string | The rule that filed it. |
rule_nameRequired | string | That rule's name. |
subject_idRequired | string | The transaction, now filed. |
AnswerIn
| Name | Type | Description |
|---|---|---|
account_id | string or null | An id that starts with |
answerRequired | string | |
dimensions | array of LineDimensionIn | The department, and any other dimension value, the transaction names when it is filed. A value it already names stands. |
rule | AnswerRuleIn or null | "Do this every time": write a rule from this answer, so the same question is never asked again. The transaction is filed under the rule's account when |
FilingRefusedOut
Why an answer filed nothing, though it was kept.
| Name | Type | Description |
|---|---|---|
codeRequired | string | The refusal's code, as filing or writing the rule alone returns it. |
messageRequired | string |
LineDimensionIn
| Name | Type | Description |
|---|---|---|
dimension_idRequired | string | An id that starts with |
value_idRequired | string | A value of that dimension. |
AnswerRuleIn
"Do this every time": the narrowest rule covering the transaction —
its counterparty by name (or its description, when it names none), on
the same event type — filing to account_id.
| Name | Type | Description |
|---|---|---|
account_idRequired | string | The GL account every matching transaction is filed to. |
dimensions | array of LineDimensionIn | The department, and any other dimension value, a matching transaction names. |
document_kind | string or null | Only with this paper behind it: an invoice, receipt, none |
memo_pattern | string or null | Only when the memo — the description, or the line the bank printed — holds these words. |