UNAUTHORIZED[01]

UNAUTHORIZED

The Authorization header is missing, malformed, or holds a key that isn't active.

Code · HTTP status · Retryable?
UNAUTHORIZED[401][No]

What this means

[02]

UNAUTHORIZED fires when the `Authorization` header is missing, doesn't start with `Bearer ` (the prefix is case-sensitive), or the key doesn't match an active API key. Keys don't expire. A key stops working when it's revoked, and that takes effect on the next request.

When you'll see it

[03]

HTTP 401. Body always includes code: "UNAUTHORIZED". Branch on code, never on the human-readable message — wording can change without notice; the code is the stable contract.

Example response

[04]
example response[json]
{
  "status": "error",
  "code": "UNAUTHORIZED",
  "message": "Missing or invalid API key"
}

How to handle

[05]

Check the header reads exactly `Authorization: Bearer <key>`. If the key was revoked, create a new one at app.buildonto.dev/read/keys. An account has one active key: creating a new key revokes the old one, so update every service that uses it at the same time. Keep the key in an environment variable, and don't commit or log it.

Suggested handling in a Node client:

if (data.code === 'UNAUTHORIZED') {
  // Missing or revoked key — retrying won't help.
  notifyOps('Onto API key is invalid; create a new one in the dashboard');
  throw new Error('Onto: UNAUTHORIZED — check your key');
}
Code · Status · What it means
PLAN_RESTRICTED[HTTP 403]

The action needs a higher plan, such as buying credits on the Free plan.

A paid plan used up its monthly credits and has no bought credits left.

See the full error index for the complete catalog with the handling switch statement covering every code at once.