Skip to main content

Alert settings

A member can ask Budget Thing to email them when a category is overspent or an account's balance drops below a threshold. Alerts are opt-in and off by default. The settings belong to the signed-in member in one workspace: another member can neither read nor change them, and the same member has separate settings in each workspace.

All paths are under /v1/workspaces/{workspaceID}.

OperationMethod and pathSuccess
get-alert-settingsGET /me/alert-settings200 with the settings
update-alert-settingsPUT /me/alert-settings200 with the saved settings

The settings object​

{
"overspendingAlerts": true,
"lowBalanceAlerts": true,
"weeklySummary": true,
"weeklySummaryWeekday": "monday",
"accountThresholds": [
{ "accountId": "acct_9fKx2mQ", "threshold": { "minor": 5000, "display": "$50.00" } }
]
}
FieldMeaning
overspendingAlertsEmail me when a category is overspent (its balance is below zero) in the current budget period. false when never saved.
lowBalanceAlertsEmail me when a watched account's balance drops below its threshold. false when never saved.
weeklySummaryEmail me a weekly summary of this workspace. false when never saved. Turning it on is all it takes: the summary is emailed once a week on weeklySummaryWeekday, see the weekly summary.
weeklySummaryWeekdayThe day the weekly summary goes out: sunday, monday, tuesday, wednesday, thursday, friday or saturday. monday when never saved.
accountThresholdsThe watched accounts, ordered by accountId. They only alert while lowBalanceAlerts is true. Never null.

PUT replaces the alert settings. Its body takes overspendingAlerts and lowBalanceAlerts (both required), weeklySummary and weeklySummaryWeekday (both optional: leave them out to keep the saved values, so a client written before they existed never switches the summary off; a day that is not one of the lowercase weekday names above is refused with 422) and accountThresholds, a list of up to 200 { "accountId", "thresholdMinor" } entries. thresholdMinor is in the workspace-scaled minor unit, like other request amounts (cents at currency precision 2), and is zero or more; 0 alerts when the account is overdrawn. An account left out of the list is no longer watched.

A threshold is refused with 422 when the account is not an open asset account of this workspace (a closed, archived, foreign or unknown account, or a liability such as a credit card), when an account appears twice, or when the amount is negative. Nothing is saved when any entry is refused.

Only a new or changed threshold is checked. A threshold saved earlier on an account that has since been closed, archived or changed to a liability type is no longer returned by GET, is not checked again, and is removed by the next PUT, so it never blocks a save. Listing it again with a different amount is refused with 422.

Who can use it​

The operations always act on the authenticated member; none takes a user ID.

  • GET works for any active member of the workspace and returns everything off for a member who never saved settings.
  • PUT needs the owner, admin or editor role; other roles get 403.
  • A caller who is not a member gets 404, as for every workspace operation.
  • No scope covers these operations, so a personal access token and a connected app are refused, as they are for your profile: a token must never be able to switch on email to the member who made it.

How the emails are sent​

An hourly background job emails each member who opted in, from 7:00 in the workspace's time zone:

  • Overspending: once per category and budget period. A category still overspent in the next period is reported once for that period. Going negative again later in the same period sends nothing more.
  • Low balance: once per account each time its balance drops below the threshold. A claim is kept while the balance stays below; it is cleared when the balance is at the threshold or above, so the next drop alerts again. Changing or removing a threshold, or turning the alert off, also clears it.
  • Only members who are currently an owner, admin or editor of the workspace are emailed. A member who left, or whose role no longer allows editing, gets nothing, and so does an account being deleted.
  • One email per member and workspace covers everything due in that run, up to 50 items; the rest go out in the next run. A failed send is retried on the next run.

The weekly summary​

With weeklySummary on, the same hourly job emails the member one summary a week for the workspace, from 7:00 in the workspace's time zone on weeklySummaryWeekday. It is sent on that day only: a day the job missed is not made up later. Turning it on after 7:00 on the chosen day sends the first one that day.

  • It lists what is left to assign, the overspent categories (the same rule as the overspending alert), the bills due in the seven days from that day that are not paid or skipped, and the inbox count of imported transactions waiting for review.
  • It is available on every plan. The bills line appears only when the workspace's plan includes bills, and the inbox line only when it includes bank sync.
  • A summary is sent at most once for a member, workspace and week, even when several API servers run the job. It is retried within the same day only when the mail could not be sent.
  • The same people are emailed as for alerts: current owners, admins and editors, not an account being deleted.
  • The email has an unsubscribe link (the RFC 8058 List-Unsubscribe header and a link in the message). It is signed for that member and that workspace with scope weekly_summary and turns off weeklySummary for that workspace only, keeping the chosen weekday. See Unsubscribing from an alert email. The email also links to the workspace's alert settings.

The alert emails and settings are personal: they are not part of a backup, a data export or a workspace clone, so after restoring or cloning a workspace each member turns alerts on again. The operations publish no webhook events and add no API scopes. Separately, overspending is available to integrations as the workspace-level category.overspent event.

Unsubscribing from an alert email​

Each alert email and each weekly summary email carries the RFC 8058 headers List-Unsubscribe and List-Unsubscribe-Post: List-Unsubscribe=One-Click, and a visible link to a confirmation page in the app, both holding a signed token scoped to one member, one workspace and one switch. POST /v1/email/alerts/unsubscribe?token=<token> (unsubscribe-alert-emails) turns that switch off, the same as saving it as false with PUT /v1/workspaces/{workspaceID}/me/alert-settings: the alert state that was already sent is forgotten, and account thresholds are kept. For weekly_summary there is no alert state to forget and the chosen weekday is kept. An email that lists both kinds of alert carries a token for both switches (scope is all); one that lists a single kind carries overspending or low_balance. The weekly summary email carries a token with scope weekly_summary, which turns off only weeklySummary; all never includes it, and the alert scopes never turn the summary off.

  • It is public: the signed token is the credential, and no bearer token is taken. It is rate limited per client address like other unauthenticated routes, and a personal access token can't use it.
  • A token is valid for its member, workspace and scope only. It can't switch off another workspace, another member's alerts or any other email, and notification and product-email tokens aren't accepted here. Tokens don't expire, so the link in an old email keeps working.
  • A mail client's one-click body is accepted and ignored; any body works.
  • It is idempotent. A valid token returns 200 with {"status":"unsubscribed","scope":"low_balance"} even when the alert is already off, the member has left the workspace or the workspace was deleted, so the response says nothing about membership. A malformed or forged token returns 400.
  • There is no GET. Mail scanners fetch links, so only the POST changes anything.
  • A deployment without an unsubscribe secret sends alert emails without the link and headers.