API reference
Model proposals
Every GL account a model proposed for a transaction, with the evidence shown when LedgerIt researched an inbox item, and the department and spread it proposed.
- GET
/v1/model_proposalsList what a model proposed for each transaction - GET
/v1/model_proposals/{proposal_id}Get a model proposal with its evidence
Guides: Work the inbox
List what a model proposed for each transaction
GET/v1/model_proposals
client.modelProposals.list()
Every category a model proposed in these books, newest first: the ones that filed themselves, the ones a gate held for a person and the ones a person overruled, each with the evidence it was shown when the books researched it.
Parameters
| Name | Type | Description |
|---|---|---|
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
transaction_idQuery | string or null | An id that starts with |
outcomeQuery | string or null | Only proposals with this outcome. posted, below_confidence, above_materiality, new_counterparty, invalid |
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/model_proposals" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Get a model proposal with its evidence
GET/v1/model_proposals/{proposal_id}
client.modelProposals.get()
One proposal: the account, its confidence and reasoning, what became of it, and — when the books researched an Inbox item — the evidence the model was shown and the department and spread it proposed.
Parameters
| Name | Type | Description |
|---|---|---|
proposal_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/model_proposals/{proposal_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
ModelProposalPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of ModelProposalOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ModelProposalOut
| Name | Type | Description |
|---|---|---|
agreed | boolean or null | Whether that person agreed. Null until someone filed it. |
confidence | string or null | 0 to 1, as the model said. |
created_atRequired | string (date-time) | |
evidence | array of EvidenceOut | What the books showed the model when they researched it. Empty for a proposal from a categorizer batch. |
human_account_id | string or null | An id that starts with |
idRequired | string | An id that starts with |
modelRequired | string | The model or prompt version that answered. |
outcomeRequired | string | What became of it: posted, below_confidence, above_materiality, new_counterparty, invalid |
prompt_versionRequired | string | |
proposed_account_code | string or null | |
proposed_account_id | string or null | An id that starts with |
proposed_account_name | string or null | |
proposed_department_id | string or null | An id that starts with |
proposed_department_name | string or null | |
proposed_spread | SpreadOut or null | The prepaid spread proposed, when the payment buys more than a month. |
reasoning | string or null | The model's one line on why. |
transaction_idRequired | string | The transaction it is about. |
EvidenceOut
One thing the books knew about a transaction when it was researched.
| Name | Type | Description |
|---|---|---|
account_code | string or null | The account it points to: its code. |
account_name | string or null | That account's name. |
count | integer or null | For |
kindRequired | string | What it is: prior_filings, counterparty_default, rule_near_miss, document, source_record, similar_transaction |
noteRequired | string | The line the model was shown, in English. |
ref | string or null | The record it is about, by kind: a GL account, a rule, a document, a source record or a transaction. |
since | string or null | For |
text | string or null | The words quoted: what a receipt says, the card program's category, the rule's name or the other transaction's description. |
SpreadOut
A prepaid spread: the payment covers this many months from start.
| Name | Type | Description |
|---|---|---|
monthsRequired | integer | How many months the payment covers. |
startRequired | string (date) | The first month it covers (its first day). |