API reference
Connections
Each provider the books are connected to, read only: whether it syncs, when it last did, what went wrong, and whether it may read the provider's people.
- GET
/v1/connectionsList the books' connections - GET
/v1/connections/{connection_id}Get a connection and how it is doing
Guides: Connect your banks, cards, payroll and revenue
List the books' connections
GET/v1/connections
client.connections.list()
The books' connections, oldest first, each with how it is doing: in plain words, against its freshness target, with any reauth deadline, how much of its history is in, and whether it may read the provider's people.
Parameters
| Name | Type | Description |
|---|---|---|
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
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/connections" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Get a connection and how it is doing
GET/v1/connections/{connection_id}
client.connections.get()
One connection and how it is doing. Never its credentials.
Parameters
| Name | Type | Description |
|---|---|---|
connection_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/connections/{connection_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
ConnectionPage
A page of the books' connections.
| Name | Type | Description |
|---|---|---|
dataRequired | array of ConnectionOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ConnectionOut
A connection's state. Never its credentials.
| Name | Type | Description |
|---|---|---|
account_idRequired | string or null | An id that starts with |
configuredRequired | boolean | Whether credentials are on file. Never the credentials themselves. |
health | ConnectionHealthOut or null | How it is doing; given when connections are listed or read one by one. |
idRequired | string | An id that starts with |
kindRequired | string |
|
labelRequired | string or null | What tells two connections to one provider apart. |
last_errorRequired | string or null | What went wrong last, in the provider's words; null when nothing did. |
last_synced_atRequired | string (date-time) or null | When it last synced, successfully or not. |
people_unreadable_since | string (date-time) or null | Since when the provider has refused to let the books read its people (Brex |
providerRequired | string | What it connects: |
statusRequired | string |
|
ConnectionHealthOut
How the connection is doing, in plain terms (PLAN.md §8.3).
| Name | Type | Description |
|---|---|---|
backfill_fromRequired | string (date) | How far back its history is asked for: 12 months. |
backfill_progressRequired | number | 0 to 1: how much of that history is in. |
behind_by_hoursRequired | number or null | How far past its target it is; null within it. |
freshness_target_hoursRequired | integer | How recent its last good sync should be: 24, or 1 for Stripe. |
history_fromRequired | string (date) or null | The oldest transaction it has brought in. |
last_success_atRequired | string (date-time) or null | The last sync that succeeded. |
reauth_byRequired | string (date-time) or null | When the provider needs a person to sign in again, if it says. |
stateRequired | string |
|