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.

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

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

transaction_idQuerystring or null

An id that starts with txn_.

outcomeQuerystring or null

Only proposals with this outcome.

One of posted, below_confidence, above_materiality, new_counterparty, invalid

Response

200ModelProposalPage

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

NameTypeDescription
proposal_idPath · Requiredstring

An id that starts with prop_.

Response

200ModelProposalOut

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

Objects

The objects these operations take and return.

ModelProposalPage

NameTypeDescription
dataRequiredarray of ModelProposalOut
has_moreRequiredboolean
next_cursorRequiredstring or null

ModelProposalOut

NameTypeDescription
agreedboolean or null

Whether that person agreed. Null until someone filed it.

confidencestring or null

0 to 1, as the model said.

created_atRequiredstring (date-time)
evidencearray of EvidenceOut

What the books showed the model when they researched it. Empty for a proposal from a categorizer batch.

human_account_idstring or null

An id that starts with gla_.

idRequiredstring

An id that starts with prop_.

modelRequiredstring

The model or prompt version that answered.

outcomeRequiredstring

What became of it: posted (filed on its own), below_confidence, above_materiality, new_counterparty (held for a person by that gate) or invalid.

One of posted, below_confidence, above_materiality, new_counterparty, invalid
prompt_versionRequiredstring
proposed_account_codestring or null
proposed_account_idstring or null

An id that starts with gla_.

proposed_account_namestring or null
proposed_department_idstring or null

An id that starts with dimv_.

proposed_department_namestring or null
proposed_spreadSpreadOut or null

The prepaid spread proposed, when the payment buys more than a month.

reasoningstring or null

The model's one line on why.

transaction_idRequiredstring

The transaction it is about.

EvidenceOut

One thing the books knew about a transaction when it was researched.

NameTypeDescription
account_codestring or null

The account it points to: its code.

account_namestring or null

That account's name.

countinteger or null

For prior_filings: how many times.

kindRequiredstring

What it is: prior_filings (the payee filed here before), counterparty_default (the account a person set for the payee), rule_near_miss (a rule whose pattern matched but whose conditions did not), document (an attached receipt or invoice), source_record (what the card program said) or similar_transaction (another payee's transaction like it).

One of prior_filings, counterparty_default, rule_near_miss, document, source_record, similar_transaction
noteRequiredstring

The line the model was shown, in English.

refstring or null

The record it is about, by kind: a GL account, a rule, a document, a source record or a transaction.

sincestring or null

For prior_filings, the first such filing; for similar_transaction, its date. ISO 8601.

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

NameTypeDescription
monthsRequiredinteger

How many months the payment covers.

startRequiredstring (date)

The first month it covers (its first day).