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.
- GET
/v1/contributionsList the accounting work done in the books, and by whom - GET
/v1/contributions/calendarGet contributions per day, for a heatmap - GET
/v1/contributions/feedRead the books' activity feed, work done together grouped - GET
/v1/contributions/statsGet a contributor's totals, streaks and kinds of work - GET
/v1/contributions/{contribution_id}Get one contribution and what it changed
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
| Name | Type | Description |
|---|---|---|
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
actor_idQuery | string or null | An id that starts with |
actor_kindQuery | string or null | Only a person's ( user, system, model |
contribution_typeQuery | string or null | Only this kind of work. 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 |
categoryQuery | string or null | Only this family of work. transactions, reconciliation, journal, close, review, rules, records |
onQuery | string (date) or null | Only work counted on this UTC day. |
sinceQuery | string (date) or null | Only work on or after this UTC day. |
untilQuery | string (date) or null | Only work on or before this UTC day. |
subject_typeQuery | string or null | Only work on records of this kind. |
subject_idQuery | string or null | An id. Which resource it names is given by the field beside it. |
countedQuery | boolean or null |
|
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/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
| Name | Type | Description |
|---|---|---|
actor_idQuery | string or null | An id that starts with |
actor_kindQuery | string or null | Only a person's ( user, system, model |
untilQuery | string (date) or null | The last day of the range, in UTC. Defaults to today. |
daysQuery | integer | How many days, ending |
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/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
| Name | Type | Description |
|---|---|---|
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
actor_idQuery | string or null | An id that starts with |
actor_kindQuery | string or null | Only a person's ( user, system, model |
categoryQuery | string or null | Only this family of work. transactions, reconciliation, journal, close, review, rules, records |
onQuery | string (date) or null | Only work counted on this UTC day. |
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/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
| Name | Type | Description |
|---|---|---|
actor_idQuery | string or null | An id that starts with |
actor_kindQuery | string or null | Only a person's ( user, system, model |
untilQuery | string (date) or null | The last day of the range, in UTC. Defaults to today. |
daysQuery | integer | How many days, ending |
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/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
| Name | Type | Description |
|---|---|---|
contribution_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/contributions/{contribution_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
ContributionPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of ContributionOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ContributionCalendar
| Name | Type | Description |
|---|---|---|
daysRequired | array of CalendarDay | Every day of the range, oldest first, zeros included. |
first_dayRequired | string (date) | |
last_dayRequired | string (date) | |
totalRequired | integer | Contributions over the whole range. |
ContributionFeed
| Name | Type | Description |
|---|---|---|
dataRequired | array of ContributionGroupOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ContributionStats
| Name | Type | Description |
|---|---|---|
by_categoryRequired | array of CategoryCount | Each family of work, most first. |
by_typeRequired | array of TypeCount | Each kind of work, most first. |
current_streakRequired | integer | Days in a row with work, ending today or yesterday. |
days_activeRequired | integer | Days with at least one contribution. |
first_dayRequired | string (date) | |
last_dayRequired | string (date) | |
longest_streakRequired | integer | The longest run of days with work in the range. |
totalRequired | integer |
ContributionDetail
| Name | Type | Description |
|---|---|---|
actionRequired | string | The audit action it was drawn from: |
actorRequired | ContributorOut | |
amount | string or null | The transaction's or entry's amount, unsigned like theirs, a decimal string. |
audit_idRequired | string | The audit trail row it was drawn from. |
categoryRequired | string | The family it counts under on a profile: transactions, reconciliation, journal, close, review, rules, records |
changesRequired | array of ChangeOut | What the work changed, before and after. |
contribution_typeRequired | string | The kind of work: 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 |
countedRequired | boolean | 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_atRequired | string (date-time) | When the work was done. |
currency | string or null | That amount's currency. |
dayRequired | string (date) | The UTC day it counts on. |
detail | object or null | What the audit row recorded about the work; its shape varies. |
group_keyRequired | string | 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. |
idRequired | string | An id that starts with |
linesRequired | array of EntryLineOut | The journal lines it wrote or took back, as a diff. |
relatedRequired | array of RelatedOut | The records around it: transaction, entry, account, period. |
subject_idRequired | string | That record's id, prefixed for its kind. |
subject_label | string or null | The record as a person names it; null for one that is gone. |
subject_ref | string or null | What the record is opened by, where that is not its id: an entry's number, a period's |
subject_typeRequired | string | The kind of record the work was on. |
via_assistant | boolean | The assistant proposed it and the member named as the actor approved it. |
weightRequired | integer | What it adds to its day: 1, 0 (a repeat) or -1 (an undo). |
ContributionOut
| Name | Type | Description |
|---|---|---|
actionRequired | string | The audit action it was drawn from: |
actorRequired | ContributorOut | |
audit_idRequired | string | The audit trail row it was drawn from. |
categoryRequired | string | The family it counts under on a profile: transactions, reconciliation, journal, close, review, rules, records |
contribution_typeRequired | string | The kind of work: 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 |
countedRequired | boolean | 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_atRequired | string (date-time) | When the work was done. |
dayRequired | string (date) | The UTC day it counts on. |
detail | object or null | What the audit row recorded about the work; its shape varies. |
group_keyRequired | string | 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. |
idRequired | string | An id that starts with |
subject_idRequired | string | That record's id, prefixed for its kind. |
subject_label | string or null | The record as a person names it; null for one that is gone. |
subject_ref | string or null | What the record is opened by, where that is not its id: an entry's number, a period's |
subject_typeRequired | string | The kind of record the work was on. |
via_assistant | boolean | The assistant proposed it and the member named as the actor approved it. |
weightRequired | integer | What it adds to its day: 1, 0 (a repeat) or -1 (an undo). |
CalendarDay
| Name | Type | Description |
|---|---|---|
countRequired | integer | Contributions that counted that day. |
dateRequired | string (date) |
ContributionGroupOut
| Name | Type | Description |
|---|---|---|
actorRequired | ContributorOut | |
categoryRequired | string | One of transactions, reconciliation, journal, close, review, rules, records |
contribution_typeRequired | string | 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 |
countRequired | integer | How many contributions the group holds on this page. |
countedRequired | integer | How many of them add to the count. |
first_atRequired | string (date-time) | The earliest of them. |
itemsRequired | array of ContributionOut | The newest 5 of them. |
keyRequired | string | Stable for the group: the same on the next page if it continues there. |
last_atRequired | string (date-time) | The latest of them. |
review | ReviewSummary or null | For the model's categorizations: how many a person has since kept or changed. |
CategoryCount
| Name | Type | Description |
|---|---|---|
categoryRequired | string | One of transactions, reconciliation, journal, close, review, rules, records |
countRequired | integer |
TypeCount
| Name | Type | Description |
|---|---|---|
categoryRequired | string | One of transactions, reconciliation, journal, close, review, rules, records |
contribution_typeRequired | string | 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 |
countRequired | integer |
ContributorOut
| Name | Type | Description |
|---|---|---|
avatar_url | string or null | Their profile picture, when they have one. |
email | string or null | Their email, while they are in these books; null once they leave. |
id | string or null | An id that starts with |
kindRequired | string |
user, system, model |
name | string or null | Their name, while they are in these books and gave one; null otherwise. |
role | string or null | Their role in these books ( |
ChangeOut
| Name | Type | Description |
|---|---|---|
after | string or null | What it is; null for nothing. |
before | string or null | What it was; null for nothing. |
fieldRequired | string | What changed: |
EntryLineOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | The GL account, prefixed. |
account_label | string or null | The account's code and name. |
amountRequired | string | A decimal string. |
directionRequired | string |
|
sideRequired | string |
+, - |
RelatedOut
| Name | Type | Description |
|---|---|---|
label | string or null | |
ref | string or null | |
roleRequired | string | How the record relates to the work. transaction, entry, account, period |
subject_idRequired | string | The record's id, prefixed for its kind; a month's is its |
subject_typeRequired | string |
ReviewSummary
| Name | Type | Description |
|---|---|---|
approvedRequired | integer | How many of the model's decisions a person kept. |
correctedRequired | integer | How many a person changed. |
reviewersRequired | array of ContributorOut | Who reviewed them. |