API reference

Notification preferences

Which kinds of notification the caller has turned off.

Guides: Settings and your team

Get where each kind of notification goes

GET/v1/notification_preferences

client.notificationPreferences.get()

Where each kind of notification reaches the caller in these books: in the app, by email, in Slack, on WhatsApp, or nowhere.

Response

200NotificationPreferencesOut

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

Choose where kinds of notification go

PATCH/v1/notification_preferences· Idempotent

client.notificationPreferences.update()

Choose where kinds of notification reach the caller, in these books only: a whole category off or back on, or one kind's channels. A kind turned off everywhere is not written at all, so nothing arrives when it is turned back on. Safe to repeat.

Request body

NotificationPreferencesIn

Response

200NotificationPreferencesOut

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

Objects

The objects these operations take and return.

NotificationPreferencesOut

NameTypeDescription
categoriesRequiredarray of CategoryPreference

Every category, in display order.

channels_availableRequiredarray of string

The channels a notice can reach the caller on in these books, in display order: the app and email always, slack while the books have a working Slack workspace connected, and whatsapp while the caller's WhatsApp number is linked to these books.

One of in_app, email, slack, whatsapp
kindsRequiredarray of KindPreferenceOut

Every kind the caller may choose channels for, in display order. A kind that cannot be changed, such as the books being scheduled for deletion, is not listed.

NotificationPreferencesIn

NameTypeDescription
categoriesarray of CategoryPreference

The categories to turn off or back on. Those left out stay as they are.

kindsarray of KindPreferenceIn

The kinds to send to new channels, applied after categories. Those left out stay as they are.

CategoryPreference

NameTypeDescription
keyRequiredstring

A group of kinds of notification, as Settings groups them.

One of connections, review, receipts, close, team, discussion, digest
mutedRequiredboolean

True when every kind in it reaches the caller nowhere in these books. Setting it false puts each of its kinds back on its default channels.

KindPreferenceOut

NameTypeDescription
categoryRequiredstring

The category Settings shows it under.

One of connections, review, receipts, close, team, discussion, digest
channelsRequiredarray of string

Where it reaches the caller in these books. Empty when it is turned off.

One of in_app, email, slack, whatsapp
channels_availableRequiredarray of string

The channels this kind can reach the caller on in these books: those of the preferences' channels_available it can go to. whatsapp only for a kind LedgerIt has an approved WhatsApp message for, such as a missing receipt.

One of in_app, email, slack, whatsapp
keyRequiredstring

A kind of notification: a notification's type.

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

KindPreferenceIn

NameTypeDescription
channelsRequiredarray of string

Where it should reach the caller in these books from now on. Empty turns it off. slack is kept even while the books have no Slack workspace connected, and whatsapp while the caller has no number linked; notices wait for one rather than going there. whatsapp for a kind that cannot go there is left out.

One of in_app, email, slack, whatsapp
keyRequiredstring

A kind of notification: a notification's type.

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