API reference

Audit events

What was done to the books and who decided it, for the whole books or one record.

Guides: See who changed what

List what was done to the books, and by whom

GET/v1/audit_events

client.auditEvents.list()

The audit trail of these books, newest first: what happened, to what, and who decided. Narrow it to one record with subject_type and subject_id for that record's history, and to a stretch of time with since and until.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

subject_typeQuerystring or null

Only what happened to records of this kind.

subject_idQuerystring or null

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

actor_kindQuerystring or null

Only what a person, the system or a model did.

One of user, system, model
actionQuerystring or null

Only this action, e.g. entry.posted.

sinceQuerystring (date-time) or null

Only what happened at or after this instant. No offset means UTC.

untilQuerystring (date-time) or null

Only what happened before this instant. No offset means UTC.

Response

200AuditEventPage

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

Objects

The objects these operations take and return.

AuditEventPage

NameTypeDescription
currencyRequiredstring

The books' currency: what every row's amount is in.

dataRequiredarray of AuditEventOut
has_moreRequiredboolean
next_cursorRequiredstring or null

AuditEventOut

NameTypeDescription
actionRequiredstring

What happened, dotted and past tense: entry.posted.

actor_avatar_urlstring or null

That member's profile picture, while they are still in the books and have one; null otherwise.

actor_emailstring or null

That member's email, while they are still in the books; null once they have left.

actor_idstring or null

An id that starts with usr_.

actor_kindRequiredstring

Who decided: user (a member, through the app or the API), system (the books themselves: a sync, a schedule, a rule) or model (a model's proposal).

One of user, system, model
amountstring or null

How much moved, in the books' currency: a posted entry's total. Null for an action that moved nothing, or whose amount is in another currency.

assistant_conversation_idstring or null

An id that starts with conv_.

created_atRequiredstring (date-time)
detailobject or null

What the action recorded about itself; its shape varies.

idRequiredstring

An id that starts with audit_.

linksarray of AuditLinkOut

The other records the action touched, each with the part it played: the accounts an entry debited and credited, the account a transaction was filed to, the entry that reversed this one.

reasonstring or null

Why, in the words of whoever did it, where they gave one: a reversal's reason, a filing's note.

request_idstring or null

The request that made the change, when one did.

subject_idRequiredstring

That record's id, prefixed for its kind. A row recorded before the record's kind took uuids names the record by its id today when it still exists, and by its old number when it does not.

subject_labelstring or null

The record as a person names it: an entry's description, a transaction's, an account's code and name, a period's month. Null for a kind with no name of its own, and for a record that is gone.

subject_refstring or null

What the record is opened by, where that is not its id: an entry's number, a period's YYYY-MM key, the id of the account a reconciliation checked.

subject_typeRequiredstring

The kind of record it happened to: journal_entry, financial_event (a transaction), account, accounting_period, …

via_assistantboolean

The change was proposed by the assistant and approved by the member named as the actor.

Default false

AuditLinkOut

NameTypeDescription
labelstring or null

The record as a person names it; null for a record that is gone.

refstring or null

What the record is opened by, where that is not its id.

roleRequiredstring

The part the record played: debit and credit (an account an entry moved), filed_to, learned_rule, reversed_by, replaced_by, from_account, to_account, matched_with or merged_into.

One of debit, credit, filed_to, learned_rule, reversed_by, replaced_by, from_account, to_account, matched_with, merged_into
subject_idRequiredstring

That record's id, prefixed for its kind.

subject_typeRequiredstring

The kind of record, as subject_type names kinds.