API reference

Contributions

The accounting work in the books, counted: who categorized, reconciled, posted or closed what, by day, as a feed and as a year.

Guides: See who did the accounting work

List the accounting work done in the books, and by whom

GET/v1/contributions

client.contributions.list()

The accounting work done in these books, newest first: who did what to which record. Narrow it to one person with actor_id, to a day with on, or to one record with subject_type and subject_id.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

actor_idQuerystring or null

An id that starts with usr_.

actor_kindQuerystring or null

Only a person's (user), the model's or the system's work.

One of user, system, model
contribution_typeQuerystring or null

Only this kind of work.

One of transaction.categorized, transaction.classified, transaction.excluded, transaction.matched, transaction.reconciled, account.reconciled, journal_entry.posted, journal_entry.updated, journal_entry.reversed, rule.created, rule.updated, exception.resolved, close_task.completed, period.closed, period.locked, period.reopened, review.completed, ai_work.approved, ai_work.corrected, counterparty.created, counterparty.updated, data.imported, evidence.attached
categoryQuerystring or null

Only this family of work.

One of transactions, reconciliation, journal, close, review, rules, records
onQuerystring (date) or null

Only work counted on this UTC day.

sinceQuerystring (date) or null

Only work on or after this UTC day.

untilQuerystring (date) or null

Only work on or before this UTC day.

subject_typeQuerystring or null

Only work on records of this kind.

subject_idQuerystring or null

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

countedQueryboolean or null

true only what counts; false only repeats and undos; leave out for both.

Response

200ContributionPage

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

Get contributions per day, for a heatmap

GET/v1/contributions/calendar

client.contributions.calendar()

A heatmap's days: how many contributions counted each day, every day of the range included. For one person with actor_id; for the whole books' people with actor_kind=user.

Parameters

NameTypeDescription
actor_idQuerystring or null

An id that starts with usr_.

actor_kindQuerystring or null

Only a person's (user), the model's or the system's work.

One of user, system, model
untilQuerystring (date) or null

The last day of the range, in UTC. Defaults to today.

daysQueryinteger

How many days, ending until. Defaults to 365.

Default 365

Response

200ContributionCalendar

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

Read the books' activity feed, work done together grouped

GET/v1/contributions/feed

client.contributions.feed()

The books' activity feed: the same as GET /contributions, with work done together — one request's bulk categorization, an hour of the model's — as one row. limit counts contributions, not rows; a group cut by the page carries the same key on the next one. For the model's categorizations, each row says how many a person has since kept or changed.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

actor_idQuerystring or null

An id that starts with usr_.

actor_kindQuerystring or null

Only a person's (user), the model's or the system's work.

One of user, system, model
categoryQuerystring or null

Only this family of work.

One of transactions, reconciliation, journal, close, review, rules, records
onQuerystring (date) or null

Only work counted on this UTC day.

Response

200ContributionFeed

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

Get a contributor's totals, streaks and kinds of work

GET/v1/contributions/stats

client.contributions.stats()

What a profile says at a glance: the total, each kind of work, the days active and the streaks, over the same range as the calendar.

Parameters

NameTypeDescription
actor_idQuerystring or null

An id that starts with usr_.

actor_kindQuerystring or null

Only a person's (user), the model's or the system's work.

One of user, system, model
untilQuerystring (date) or null

The last day of the range, in UTC. Defaults to today.

daysQueryinteger

How many days, ending until. Defaults to 365.

Default 365

Response

200ContributionStats

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

Get one contribution and what it changed

GET/v1/contributions/{contribution_id}

client.contributions.get()

One piece of work, with what it changed — the category before and after, the journal lines written or taken back — and the records around it: the transaction, its entry, the account and the month.

Parameters

NameTypeDescription
contribution_idPath · Requiredstring

An id that starts with contrib_.

Response

200ContributionDetail

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

Objects

The objects these operations take and return.

ContributionPage

NameTypeDescription
dataRequiredarray of ContributionOut
has_moreRequiredboolean
next_cursorRequiredstring or null

ContributionCalendar

NameTypeDescription
daysRequiredarray of CalendarDay

Every day of the range, oldest first, zeros included.

first_dayRequiredstring (date)
last_dayRequiredstring (date)
totalRequiredinteger

Contributions over the whole range.

ContributionFeed

NameTypeDescription
dataRequiredarray of ContributionGroupOut
has_moreRequiredboolean
next_cursorRequiredstring or null

ContributionStats

NameTypeDescription
by_categoryRequiredarray of CategoryCount

Each family of work, most first.

by_typeRequiredarray of TypeCount

Each kind of work, most first.

current_streakRequiredinteger

Days in a row with work, ending today or yesterday.

days_activeRequiredinteger

Days with at least one contribution.

first_dayRequiredstring (date)
last_dayRequiredstring (date)
longest_streakRequiredinteger

The longest run of days with work in the range.

totalRequiredinteger

ContributionDetail

NameTypeDescription
actionRequiredstring

The audit action it was drawn from: event.categorized.

actorRequiredContributorOut
amountstring or null

The transaction's or entry's amount, unsigned like theirs, a decimal string.

audit_idRequiredstring

The audit trail row it was drawn from.

categoryRequiredstring

The family it counts under on a profile: transactions, reconciliation, journal, close, review, rules or records.

One of transactions, reconciliation, journal, close, review, rules, records
changesRequiredarray of ChangeOut

What the work changed, before and after.

contribution_typeRequiredstring

The kind of work: transaction.categorized, account.reconciled, journal_entry.posted, ai_work.approved, …

One of transaction.categorized, transaction.classified, transaction.excluded, transaction.matched, transaction.reconciled, account.reconciled, journal_entry.posted, journal_entry.updated, journal_entry.reversed, rule.created, rule.updated, exception.resolved, close_task.completed, period.closed, period.locked, period.reopened, review.completed, ai_work.approved, ai_work.corrected, counterparty.created, counterparty.updated, data.imported, evidence.attached
countedRequiredboolean

Whether it adds to the count. The same work on the same record by the same person the same day counts once, and an undo takes that day's back.

created_atRequiredstring (date-time)

When the work was done.

currencystring or null

That amount's currency.

dayRequiredstring (date)

The UTC day it counts on.

detailobject or null

What the audit row recorded about the work; its shape varies.

group_keyRequiredstring

What it was done with: the request, or else the hour of the same work by the same actor. The feed shows one group as one row.

idRequiredstring

An id that starts with contrib_.

linesRequiredarray of EntryLineOut

The journal lines it wrote or took back, as a diff.

relatedRequiredarray of RelatedOut

The records around it: transaction, entry, account, period.

subject_idRequiredstring

That record's id, prefixed for its kind.

subject_labelstring or null

The record as a person names it; null for one 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, the account a reconciliation checked, the statement a match was on.

subject_typeRequiredstring

The kind of record the work was on.

via_assistantboolean

The assistant proposed it and the member named as the actor approved it.

Default false
weightRequiredinteger

What it adds to its day: 1, 0 (a repeat) or -1 (an undo).

ContributionOut

NameTypeDescription
actionRequiredstring

The audit action it was drawn from: event.categorized.

actorRequiredContributorOut
audit_idRequiredstring

The audit trail row it was drawn from.

categoryRequiredstring

The family it counts under on a profile: transactions, reconciliation, journal, close, review, rules or records.

One of transactions, reconciliation, journal, close, review, rules, records
contribution_typeRequiredstring

The kind of work: transaction.categorized, account.reconciled, journal_entry.posted, ai_work.approved, …

One of transaction.categorized, transaction.classified, transaction.excluded, transaction.matched, transaction.reconciled, account.reconciled, journal_entry.posted, journal_entry.updated, journal_entry.reversed, rule.created, rule.updated, exception.resolved, close_task.completed, period.closed, period.locked, period.reopened, review.completed, ai_work.approved, ai_work.corrected, counterparty.created, counterparty.updated, data.imported, evidence.attached
countedRequiredboolean

Whether it adds to the count. The same work on the same record by the same person the same day counts once, and an undo takes that day's back.

created_atRequiredstring (date-time)

When the work was done.

dayRequiredstring (date)

The UTC day it counts on.

detailobject or null

What the audit row recorded about the work; its shape varies.

group_keyRequiredstring

What it was done with: the request, or else the hour of the same work by the same actor. The feed shows one group as one row.

idRequiredstring

An id that starts with contrib_.

subject_idRequiredstring

That record's id, prefixed for its kind.

subject_labelstring or null

The record as a person names it; null for one 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, the account a reconciliation checked, the statement a match was on.

subject_typeRequiredstring

The kind of record the work was on.

via_assistantboolean

The assistant proposed it and the member named as the actor approved it.

Default false
weightRequiredinteger

What it adds to its day: 1, 0 (a repeat) or -1 (an undo).

CalendarDay

NameTypeDescription
countRequiredinteger

Contributions that counted that day.

dateRequiredstring (date)

ContributionGroupOut

NameTypeDescription
actorRequiredContributorOut
categoryRequiredstringOne of transactions, reconciliation, journal, close, review, rules, records
contribution_typeRequiredstringOne of transaction.categorized, transaction.classified, transaction.excluded, transaction.matched, transaction.reconciled, account.reconciled, journal_entry.posted, journal_entry.updated, journal_entry.reversed, rule.created, rule.updated, exception.resolved, close_task.completed, period.closed, period.locked, period.reopened, review.completed, ai_work.approved, ai_work.corrected, counterparty.created, counterparty.updated, data.imported, evidence.attached
countRequiredinteger

How many contributions the group holds on this page.

countedRequiredinteger

How many of them add to the count.

first_atRequiredstring (date-time)

The earliest of them.

itemsRequiredarray of ContributionOut

The newest 5 of them.

keyRequiredstring

Stable for the group: the same on the next page if it continues there.

last_atRequiredstring (date-time)

The latest of them.

reviewReviewSummary or null

For the model's categorizations: how many a person has since kept or changed.

CategoryCount

NameTypeDescription
categoryRequiredstringOne of transactions, reconciliation, journal, close, review, rules, records
countRequiredinteger

TypeCount

NameTypeDescription
categoryRequiredstringOne of transactions, reconciliation, journal, close, review, rules, records
contribution_typeRequiredstringOne of transaction.categorized, transaction.classified, transaction.excluded, transaction.matched, transaction.reconciled, account.reconciled, journal_entry.posted, journal_entry.updated, journal_entry.reversed, rule.created, rule.updated, exception.resolved, close_task.completed, period.closed, period.locked, period.reopened, review.completed, ai_work.approved, ai_work.corrected, counterparty.created, counterparty.updated, data.imported, evidence.attached
countRequiredinteger

ContributorOut

NameTypeDescription
avatar_urlstring or null

Their profile picture, when they have one.

emailstring or null

Their email, while they are in these books; null once they leave.

idstring or null

An id that starts with usr_.

kindRequiredstring

user (a member), model (the model's own work) or system (the books themselves: a sync, a schedule).

One of user, system, model
namestring or null

Their name, while they are in these books and gave one; null otherwise.

rolestring or null

Their role in these books (owner, accountant, …); null once they leave.

ChangeOut

NameTypeDescription
afterstring or null

What it is; null for nothing.

beforestring or null

What it was; null for nothing.

fieldRequiredstring

What changed: category, counterparty, or a field's own name.

EntryLineOut

NameTypeDescription
account_idRequiredstring

The GL account, prefixed.

account_labelstring or null

The account's code and name.

amountRequiredstring

A decimal string.

directionRequiredstring

debit or credit.

sideRequiredstring

+ a line written, - a line taken back.

One of +, -

RelatedOut

NameTypeDescription
labelstring or null
refstring or null
roleRequiredstring

How the record relates to the work.

One of transaction, entry, account, period
subject_idRequiredstring

The record's id, prefixed for its kind; a month's is its YYYY-MM.

subject_typeRequiredstring

ReviewSummary

NameTypeDescription
approvedRequiredinteger

How many of the model's decisions a person kept.

correctedRequiredinteger

How many a person changed.

reviewersRequiredarray of ContributorOut

Who reviewed them.