API reference

Large transaction alerts

Who hears when money over an amount moves: roles, members and outside addresses, told once per transaction.

Guides: Settings and your team

List the books' large transaction alerts

GET/v1/transaction_alert_rules

client.transactionAlertRules.list()

The books' large transaction alerts, the newest first: which way, over how much, and who hears.

Parameters

NameTypeDescription
directionQuerystring or null

Only rules on money out, in or any.

One of out, in, any
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200TransactionAlertRulePage

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

Alert people when money over an amount moves

POST/v1/transaction_alert_rules· Idempotent

client.transactionAlertRules.create()

Alert people when money over an amount moves. Every transaction that arrives from now on, dated within the last week and over min_amount in currency, is alerted once: in the app and by email to the members it names (each on the channels they chose), and by email to emails. A pending charge is alerted, and the charge that settles it is not again; transfers between the books' own accounts are not alerted. Name at least one role, member or address.

Request body

TransactionAlertRuleCreate

Response

201TransactionAlertRuleOut

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/transaction_alert_rules" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"min_amount":0}'

Get a large transaction alert

GET/v1/transaction_alert_rules/{rule_id}

client.transactionAlertRules.get()

One large transaction alert.

Parameters

NameTypeDescription
rule_idPath · Requiredstring

An id that starts with txn_alert_rule_.

Response

200TransactionAlertRuleOut

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

Change a large transaction alert

PATCH/v1/transaction_alert_rules/{rule_id}

client.transactionAlertRules.update()

Change which way, how much or who hears. Only the fields sent change; a list sent replaces the one there. A transaction already alerted is not alerted again.

Parameters

NameTypeDescription
rule_idPath · Requiredstring

An id that starts with txn_alert_rule_.

Request body

TransactionAlertRuleUpdate

Response

200TransactionAlertRuleOut

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/transaction_alert_rules/{rule_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete a large transaction alert

DELETE/v1/transaction_alert_rules/{rule_id}

client.transactionAlertRules.delete()

Stop alerting on this rule. The alerts it already sent stay in each member's notifications.

Parameters

NameTypeDescription
rule_idPath · Requiredstring

An id that starts with txn_alert_rule_.

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

Objects

The objects these operations take and return.

TransactionAlertRulePage

NameTypeDescription
dataRequiredarray of TransactionAlertRuleOut
has_moreRequiredboolean
next_cursorRequiredstring or null

TransactionAlertRuleCreate

NameTypeDescription
currencystring or null

An ISO 4217 code. The books' own by default.

directionstring

Which way the money moves. Money out by default.

One of out, in, anyDefault out
emailsarray of string

Addresses outside the membership that are emailed: a person, or a group such as finance@.

Default []
member_idsarray of string

Members who hear whatever their role.

Default []
min_amountRequirednumber | string

Alert on a transaction moving at least this much.

rolesarray of string

Every member with one of these roles hears.

One of owner, admin, accountant, member, viewerDefault []

TransactionAlertRuleOut

NameTypeDescription
created_atRequiredstring (date-time)
created_byRequiredstring or null

An id that starts with usr_.

currencyRequiredstring

The currency it is compared in. Transactions in another are not alerted.

directionRequiredstring

out for money leaving, in for money arriving, any for either.

One of out, in, any
emailsRequiredarray of string

Addresses outside the membership that are emailed.

idRequiredstring

An id that starts with txn_alert_rule_.

member_idsRequiredarray of string

Members who hear whatever their role.

min_amountRequiredstring

A transaction moving at least this much is alerted.

rolesRequiredarray of string

Every member with one of these roles hears.

One of owner, admin, accountant, member, viewer
updated_atRequiredstring (date-time)

TransactionAlertRuleUpdate

NameTypeDescription
currencystring or null

An ISO 4217 code.

directionstring or nullOne of out, in, any
emailsarray of string or null

Addresses outside the membership that are emailed: a person, or a group such as finance@.

member_idsarray of string or null

Members who hear whatever their role.

min_amountnumber | string or null

Alert on a transaction moving at least this much.

rolesarray of string or null

Every member with one of these roles hears.

One of owner, admin, accountant, member, viewer