SpendRock Docs

Errors

The error format, HTTP statuses, and every error code.

Format

Every error response has a JSON body with a stable, machine-readable code and a human-readable message. Some add details.

{
  "code": "splits_do_not_sum",
  "message": "The splits add up to $50.00, but the amount is $54.20.",
  "details": { }
}
  • Branch on code, never on message. Codes are stable within /v1; messages may change.
  • message is safe to show to a user.
  • details is an object whose contents depend on the code (for example details.required_scope for insufficient_scope). Ignore keys you don't know.
  • New codes may be added in /v1. Treat an unknown code by its HTTP status.

Statuses

StatusMeaning
400The request didn't parse: malformed JSON, a wrong type, or a bad parameter (invalid).
401No valid credentials: missing, revoked, or expired token.
403Authenticated, but not allowed: missing scope, not a member, not the owner, and so on.
404No such thing (or no budget for that month yet).
409Conflicts with what exists: a name that's taken, a month that exists, a reused transaction ID.
410A link that was valid but isn't any more (an expired or used invite or email link).
422Well-formed, but breaks a budgeting rule (the splits don't add up, the item isn't in that month, …).
429Too many requests. See Rate limits.
500Something went wrong on our side (internal). It's reported to us automatically; retry later.

Codes

Authentication and access

CodeStatusMeaning
unauthenticated401No credentials, or the token or session is revoked or expired.
insufficient_scope403The token lacks the scope this operation needs; details.required_scope names it. See scopes.
session_required403Only a signed-in session can do this (managing tokens, changing your password).
not_invited403Signing in: the account isn't on the invite list and has no pending invite.
not_a_member403You aren't a current member of that household. See Households.
not_owner403Only the household's owner can do this.
rate_limited429Too many requests; wait Retry-After seconds.

Budgets, groups, and items

CodeStatusMeaning
not_found404No such group, item, transaction, household, or invite (or it isn't in this household).
month_not_created404 / 422The month has no budget yet: 404 when reading it, 422 when writing to it. Create it with POST /months/{month}.
month_exists409The month already has a budget.
no_previous_month409Resetting with "replace" needs an earlier budget to copy, and there isn't one.
name_taken409A group or item with that name already exists (names are unique within a budget).
income_group_protected422The Income group can't be deleted.
kind_mismatch422The item's kind doesn't allow this: income items can't be funds, favorites, or harvested, can't leave Income; funds can't be harvested; an expense can't be split to an income item.
already_fund422The item is already a fund.
not_fund422The operation only applies to funds.
nothing_to_harvest422The item has nothing left over to move back to Left to Budget.
invalid400 / 422Generic validation failure; message says what's wrong.

Transactions

CodeStatusMeaning
id_conflict409That transaction ID was already used with a different body. See Idempotency.
amount_not_positive422Amounts must be greater than zero (the type gives the direction).
split_not_positive422Every split's amount must be greater than zero.
splits_do_not_sum422The splits must add up to the transaction's amount.
duplicate_split_item422Two splits point at the same item.
item_not_in_month422A split's item doesn't exist in the transaction's budget month.

Households and invites

CodeStatusMeaning
already_member409That person is already in the household.
invite_email_mismatch403The invite was sent to a different email than the one you're signed in with.
invite_unavailable410The invite expired, or was revoked, declined, or already accepted.
last_household422You can't leave, delete, or archive your only (non-archived) household.
personal_household422Your personal household can't be deleted, and its owner can't leave it.
owner_must_transfer422Transfer ownership before leaving a household others still belong to.
default_household422Your default household can't be archived; pick another default first.
household_archived422An archived household can't be your default.
choose_default422Leaving your default household: say which household becomes the new default.

Email + password accounts

These apply only where email + password sign-in is turned on.

CodeStatusMeaning
bad_credentials401Email or password is incorrect.
email_unverified403Verify the email address first.
invalid_link410The email link expired or was already used.

Server

CodeStatusMeaning
internal500Unexpected error. Retry later; if it keeps happening, let us know.

On this page