Skip to content
briefkastencloud

Errors

Every error the API answers, what causes it, and what to do.

Errors are JSON with a stable code, a sentence for people, and sometimes details:

{
  "error": {
    "code": "plan_limit",
    "message": "your plan allows 20 sources; remove one or ask for more",
    "details": { "limit": 20, "used": 20, "plan": "free" }
  }
}

Branch on code, never on message. The SDK throws a BriefkastenError with the same code; the CLI prints the message and exits with a non-zero status.

Requests

CodeStatusCause
invalid_input400The input failed its schema. details.issues names each field and what is wrong.
invalid_json400The body is not valid JSON.
invalid_body403The body is JSON, but not an object.
body_too_large413The request is over 64 KiB.
rate_limited429Too many requests. Wait for the retry-after header's seconds.
not_found404No such endpoint, project, source, event or token.
internal500A fault on our side; it is logged. Try again.

Signing in

CodeStatusCause
invalid_email400Not an email address.
code_invalid400The sign-in code is wrong, used or replaced. details.attemptsLeft says how many tries are left.
code_expired400The code is older than ten minutes. Ask for a new one.
too_many_attempts429Five wrong codes: ask for a new one.
terms_not_accepted400The code would create an account, and the request didn't say accept_terms: true. details has terms_url, privacy_url, terms_version and privacy_version. The code stays valid: show the documents, ask, and send the same code again with accept_terms: true.
terms_version_mismatch400The terms or privacy versions sent are not the current ones. details as above.
mfa_code_invalid400The second-factor code is wrong.
mfa_token_invalid, mfa_token_expired400The second-factor step timed out. Sign in again.
device_code_unknown400No pending device sign-in has that code.
session_required400Signing out needs a session; revoke an API token instead.

The token endpoint answers OAuth errors instead: authorization_pending, slow_down, access_denied, expired_token, invalid_grant.

Access

CodeStatusCause
unauthorized401No credentials, or they are wrong or expired.
insufficient_scope403The token lacks the scope (read, write, billing, account).
read_only403An operator's read-only view of an account.
csrf403A browser request without its CSRF token, or from another site.
tenant_suspended403The account is suspended. Reading still works.
admin_mfa_required, mfa_step_up_required403The admin area needs two-factor, and a fresh code for changes.

Configuration

CodeStatusCause
project_exists, source_exists, subscriber_exists409Names are unique in their scope.
secret_required400Linear, Sentry and Nightwatch make the secret: pass theirs as secret.
unknown_subscriber400A route names a subscriber that doesn't exist.
unknown_sample400The adapter has no sample event with that name. See GET /api/v1/adapters.
nothing_to_change400An update without changes.
invalid_range400from is after to, or the range is over 400 days.
plan_limit403The plan's limit is reached. details has limit, used and plan.

Account and billing

CodeStatusCause
confirmation_mismatch400Deleting the account: the typed email doesn't match.
mfa_already_enabled, mfa_not_enabled409Two-factor is already on, or off.
mfa_setup_expired400The authenticator setup took longer than ten minutes.
notification_fixed400Security notices always arrive by email and in the app.
nothing_to_buy400Every plan here is free.
plan_current409You are already on that plan.
plan_unavailable400That plan isn't offered.
no_billing_account400There is no billing account yet.