API reference

Notifications

What LedgerIt told the caller, and marking it read.

Guides: Settings and your team

List the caller's notifications

GET/v1/notifications

client.notifications.list()

The caller's notifications in these books, newest first, with how many are unread.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

unread_onlyQueryboolean

Only the ones not read yet.

Default false

Response

200NotificationPage

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

Mark notifications read

POST/v1/notifications/read· Idempotent

client.notifications.markRead()

Mark some of the caller's notifications read, or all of them. Safe to repeat: one already read stays read.

Request body

MarkReadIn

Response

200MarkReadOut

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 -X POST "https://api.ledgerit.ai/v1/notifications/read" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Get a notification

GET/v1/notifications/{notification_id}

client.notifications.get()

One of the caller's notifications.

Parameters

NameTypeDescription
notification_idPath · Requiredstring

An id that starts with ntf_.

Response

200NotificationOut

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

Dismiss a notification

DELETE/v1/notifications/{notification_id}

client.notifications.dismiss()

Dismiss one of the caller's notifications: it leaves their inbox for good, and the same notice is not sent to them again. Theirs only.

Parameters

NameTypeDescription
notification_idPath · Requiredstring

An id that starts with ntf_.

Response

204No content

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 -X DELETE "https://api.ledgerit.ai/v1/notifications/{notification_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

NotificationPage

NameTypeDescription
dataRequiredarray of NotificationOut
has_moreRequiredboolean
next_cursorRequiredstring or null
unread_countRequiredinteger

How many of the caller's notifications in these books are unread, in all pages.

MarkReadIn

NameTypeDescription
allboolean

Mark every one of the caller's notifications read.

Default false
notification_idsarray of string or null

The notifications to mark read. Ids that are not the caller's are ignored.

MarkReadOut

NameTypeDescription
markedRequiredinteger

How many changed from unread to read.

unread_countRequiredinteger

How many are unread now.

NotificationOut

NameTypeDescription
bodyRequiredstring or null

More detail, in English, when there is any.

channelsRequiredarray of string

Where it goes, as the caller's preferences for its type stood when it was written.

One of in_app, email, slack, whatsapp
created_atRequiredstring (date-time)
dataRequiredobject

The facts behind the notice, by type: ids to link to, amounts, dates.

delivered_channelsRequiredarray of string

Where it has got to so far: in_app at once, email once the email is sent.

One of in_app, email, slack, whatsapp
idRequiredstring

An id that starts with ntf_.

readRequiredboolean

Whether the caller has seen it.

severityRequiredstring

warning when something is wrong until someone acts; info otherwise.

One of info, warning
titleRequiredstring

One line, in English. Render type and data to localize.

typeRequiredstring

What happened. Decides the keys in data.

One of connection_failing, transactions_need_review, receipt_missing, period_closed, period_reopened, member_joined, mentioned, question_asked, question_answered, filing_proposed, weekly_digest, entity_deletion_scheduled, plan_moving