---
title: Error codes
summary: Every failure Tessera reports has a stable code, an HTTP status, a cause and a fix, and the full list is published at /errors.
section: reference
order: 3
---
# Error codes

Every failure Tessera reports has a stable code, an HTTP status, a cause and a fix, and the full list is published at /errors.

Use the code, not the message text, when your program decides what to do. Codes are never renamed or reused. New ones may be added.

## Where you see a code

| Where | How it looks |
| --- | --- |
| Hosted pages (sign-in, consent, errors) | An "Error code" line the person can read out |
| Token, revoke, introspect and device endpoints | JSON with `error`, `error_description`, `error_code` and `error_uri` |
| Redirects back to your app from `/authorize` | Query parameters `error`, `error_code`, `error_uri` (and `error_description` sometimes), plus your `state` and `iss`, the issuer (RFC 9207). Check `iss` as you do on success |
| Admin API | A problem JSON object with `title`, `status`, `detail`, `request_id`, `error_code` and `error_uri` |
| The `tessera` CLI | With `-o json`, an object with `error`, `kind`, and `code`, `cause`, `fix`, `docs` when the server sent a code |

Example from the token endpoint:

```json
{
  "error": "invalid_grant",
  "error_description": "refresh token has been revoked. ...",
  "error_code": "refresh_token_revoked",
  "error_uri": "https://docs.kurthlabs.com/tessera/errors/refresh_token_revoked"
}
```

`error` is the standard OAuth value; branch on it if your library already does. `error_code` is more specific. One `error` value can have several codes: `invalid_grant` covers `authorization_code_invalid`, `refresh_token_expired`, `refresh_token_revoked`, `code_verifier_invalid` and others. `error_description` is for developers and may change.

## Look codes up

- Browse: [/errors](/errors/index.md), or open one code at `/errors/<code>`, for example [/errors/redirect_uri_mismatch](/errors/redirect_uri_mismatch.md).
- As markdown, for tools and coding agents: `/errors/<code>.md` and the index at `/errors/index.md`.
- As data: `/errors/errors.json`. It has `version`, `docs_base` and an `errors` array. Each entry has `code`, `status`, `oauth_error` (when the OAuth spec has a matching value), `title`, `message`, `cause`, `fix` and `detail`.
- Offline, from the CLI: `tessera errors` lists every code and `tessera errors <code>` shows the cause and fix. See [the CLI](/docs/reference/cli.md).

Each page says what the person sees, the cause, and the fix. The `fix` field is written to be acted on.

## Common groups

This is a guide, not the list. The full list is at [/errors](/errors/index.md).

### Setting up the app

| Code | Usually means |
| --- | --- |
| [`redirect_uri_mismatch`](/errors/redirect_uri_mismatch.md) | The `redirect_uri` is not exactly one registered on the client (loopback IP literals such as `http://127.0.0.1` match any port) |
| [`redirect_uri_invalid`](/errors/redirect_uri_invalid.md) | The admin API refused a redirect URI you tried to register: not `https`, not loopback `http`, not a reverse-domain scheme, or it has a fragment or credentials. The problem detail names the entry |
| [`client_not_found`](/errors/client_not_found.md) | The `client_id` is wrong or belongs to another realm |
| [`realm_not_found`](/errors/realm_not_found.md) | The realm name in the URL is wrong |
| [`pkce_required`](/errors/pkce_required.md) | The request has no S256 `code_challenge`, or the challenge is not 43 to 128 characters of the base64url alphabet |
| [`state_required`](/errors/state_required.md) | The request has no `state` |
| [`scope_not_allowed`](/errors/scope_not_allowed.md) | A scope is not allowed for this client |
| [`resource_invalid`](/errors/resource_invalid.md) | The `resource` is not one the client may request, or is missing for an MCP client. A plain sign-in app needs no `resource`; if it sends one, it must be its own `client_id` |
| [`host_not_registered`](/errors/host_not_registered.md) | The address is not the shared issuer or an active login domain, so Tessera answers `404`. See [domains](/docs/concepts/domains.md#only-active-domains-answer) |
| [`client_grant_not_allowed`](/errors/client_grant_not_allowed.md) | The client may not use this grant type |

### Exchanging and refreshing tokens

| Code | Usually means |
| --- | --- |
| [`authorization_code_invalid`](/errors/authorization_code_invalid.md) | The code was used already, expired after 60 seconds, or the redirect URI differs. A code used twice also revokes the tokens the first exchange produced |
| [`code_verifier_invalid`](/errors/code_verifier_invalid.md) | The PKCE verifier is missing, is not 43 to 128 characters, or does not match |
| [`client_authentication_failed`](/errors/client_authentication_failed.md) | Wrong or missing client secret. Send it in the request body or the `Authorization` header, never in the URL |
| [`introspection_requires_confidential_client`](/errors/introspection_requires_confidential_client.md) | `/introspect` was called by a public client. Use a confidential client, or validate the JWT locally |
| [`refresh_token_expired`](/errors/refresh_token_expired.md), [`refresh_token_revoked`](/errors/refresh_token_revoked.md), [`refresh_token_invalid`](/errors/refresh_token_invalid.md) | The session ended or the token was used twice; sign in again |
| [`access_token_invalid`](/errors/access_token_invalid.md) | A bearer token is missing, expired, revoked or for another audience |

### Devices and agents

| Code | Usually means |
| --- | --- |
| [`authorization_pending`](/errors/authorization_pending.md) | Keep polling; the person has not approved yet |
| [`slow_down`](/errors/slow_down.md) | Poll less often. Add 5 seconds to your interval each time you see it |
| [`device_code_invalid`](/errors/device_code_invalid.md) | The device code is unknown or used. A pending code is also invalidated after repeated refused approvals |
| [`device_code_expired`](/errors/device_code_expired.md) | Start a new device authorization |
| [`assertion_untrusted`](/errors/assertion_untrusted.md), [`assertion_invalid`](/errors/assertion_invalid.md) | A workload token is not from a trusted issuer or is malformed |

### Signing in and limits

| Code | Usually means |
| --- | --- |
| [`sign_in_failed`](/errors/sign_in_failed.md), [`sign_in_expired`](/errors/sign_in_expired.md) | The person's sign-in did not complete |
| [`sign_up_not_allowed`](/errors/sign_up_not_allowed.md) | The realm is invite-only and this address has no invite |
| [`client_access_denied`](/errors/client_access_denied.md) | The person lacks a role the app requires |
| [`csrf_mismatch`](/errors/csrf_mismatch.md), [`form_malformed`](/errors/form_malformed.md) | A hosted page's form expired or could not be read; reload the page and submit it again. Integrations must not post to hosted forms |
| [`rate_limited`](/errors/rate_limited.md) | Too many attempts; wait and retry (see `Retry-After`) |
| [`server_busy`](/errors/server_busy.md), [`temporarily_unavailable`](/errors/temporarily_unavailable.md) | Retry shortly |
| [`server_error`](/errors/server_error.md), [`internal_error`](/errors/internal_error.md) | A problem on Tessera's side; report the `request_id` if you have one |

## What to do in code

- `invalid_grant` on a refresh: the grant is over. Clear your session and send the person to sign in.
- `authorization_pending` and `slow_down`: keep polling the device endpoint, 5 seconds slower after each `slow_down`.
- `rate_limited`, `server_busy`, `temporarily_unavailable`, `server_error`: retry with backoff.
- Any other `400` or `401` from `/authorize` or `/token`: do not retry. Read the code's page; the request or the app's settings need to change.
