Skip to Content
Otoko Identity

Errors

Every error code Otoko Identity answers your app and your backend with, and what to do about it.

Errors

What a failed sign-in or a refusal looks like from your app, and why, is on Troubleshooting. This page lists the codes themselves.

How an error looks

Every route but the OAuth ones answers an error as problem details (RFC 9457), application/problem+json:

{
  "type": "about:blank",
  "title": "Conflict",
  "status": 409,
  "detail": "this app already has an account with this email",
  "code": "conflict",
  "error": "conflict",
  "request_id": "0f8e2a61-0000-4000-8000-000000000000",
  "reason": "this app already has an account with this email"
}
  • code is the stable key to act on. error holds the same value, kept for older clients.
  • reason, when there is one, says more. detail repeats it, or the status's name.
  • A 422 from a body that doesn't match the route lists every field in errors: [{field, reason}]. Values sent are never echoed.
  • A 429 has retry_after_seconds and a Retry-After header.
  • Quote request_id when you ask for help.

The OAuth endpoints answer as their standards say instead. See OAuth endpoints.

Any route

CodeStatusMeans, and what to do
invalid_request422The body, query, path or a header doesn't match the route. Fix the fields errors names.
not_found404No such route. Check the address and the /internal/v1 prefix.
method_not_allowed405The route takes other methods: see the Allow header.
body_too_large413The body is over the limit, 2 MiB on /internal/, and was refused before it was read. Send less, such as a smaller batch of roles.
rate_limited429Too many tries, or too much load at once. Wait Retry-After seconds and try again.
resource_busy503Another change held the same record. Try again after a second.
internal_error500Our failure. Quote the request_id.
idempotency_key_reused422The Idempotency-Key was used before with a different body. Use a new random key for a new request.
idempotency_key_in_flight409The first request with this key is still running. Try again shortly to get its answer.

An Idempotency-Key is taken by POST /internal/v1/identities, /identities/{id}/code and /identities/{id}/password-email, POST /internal/v1/invitations and /invitations/{id}/emails, and POST /internal/v1/passkeys.

Your backend's calls

The routes under /internal/v1 that your backend calls.

CodeStatusWhereMeans, and what to do
invalid_api_key401Every routeNo Authorization: Bearer with a live API key of an enabled app. After a rotation, the previous key works only until it retires.
identity_not_found404Routes with an identity's id, and GET /identities?email=The app has no such person. Another app's people read the same. DELETE /identities/{id} answers 204 instead.
conflict409POST /identitiesThe app already has someone with this email. Look them up with GET /identities?email=.
password_too_short, password_too_long, password_compromised422POST /identities with a password, PUT /identities/{id}/passwordThe password breaks the rules: too short, too long, or on the list of known leaked passwords. Ask for another.
invalid_action_code400POST /action-codes/redemptionThe required action's code is unknown, used, expired, another app's, or doesn't match the sign-in's PKCE verifier. Every case reads the same. Start the sign-in again.
roles_owned_by_admin409PUT /identities/{id}/roles, PUT /identities/roles, POST /invitations with rolesThe app's roles are set in the console. Change the app's roles owner, or stop sending roles.
role_not_defined422The sameA role the app doesn't have. Add it on the app's Users & roles tab, or fix the name.
app_roles_not_set_up422The sameThe app has no roles at all yet. Set them up first.
invalid_code400POST /identities/{id}/code-checksThe code is wrong, expired or used. Let the person try again, or send a new one.
rate_limited429POST /identities/{id}/code-checks, POST /unknown-addresses/code-failuresToo many wrong codes for the address. Wait retry_after_seconds.
mail_server_not_set_up503Sending a code, a set-password link or an invitationThe app's chosen mail server isn't set up. See Emails.
invalid_redirect_uri422POST /identities/{id}/password-email, POST /invitationsredirect_uri isn't exactly one of the app's password-reset redirect addresses.
email_not_found404GET /emails/{id}An unknown email id, another app's, or one settled more than 30 days ago.

PUT /internal/v1/identities/roles answers 200 even when some people are refused: they come back in refused, each with its id, error and reason, while the rest are applied.

Sessions

CodeStatusWhereMeans, and what to do
no_mobile_client403Every /sessions route but password-checks, and every /passkeys routeThe app has no mobile client. Add one on its Clients tab.
app_not_set_up503Signing in by password or passkeyThe mobile client has the email gate on with no roles allowed. See Roles and the email gate.
invalid_credentials401Signing in by password or passkeyA wrong password, an unknown email, an email still to verify on an app whose account flows are Identity's own, or any problem with a passkey. Every case reads the same, on purpose: show one message.
wrong_application403The sameYour sign-in check said no.
account_setup_incomplete403The sameThe person has a required action pending. Show your own screen for it.
passkeys_not_enabled403Passkey routesPasskeys are off for the mobile client. Turn them on on its Clients tab.
unavailable503Signing in, and POST /sessions/refreshesYour sign-in check couldn't be reached, and the app's outage policy is Refuse sign-in. On a refresh the session is kept. Try again later.
invalid_grant400POST /sessions/refreshesThe refresh token is dead: expired, already used, ended or another client's, or the sign-in check now says no. Sign in again.

A person's passkeys

CodeStatusWhereMeans, and what to do
not_signed_in401Every /passkeys routeNo current access token in X-Access-Token, or one that isn't the mobile client's. Refresh it if it expired.
fresh_check_required403POST /passkeys/registration and POST /passkeysNeither a password nor a code was given, or the challenge is too old. Start again with one.
code_required403POST /passkeys/registrationThe account has failed too often, so a code was emailed. Send it as code.
invalid_credentials401POST /passkeys/registrationWrong password.
invalid_code400POST /passkeys/registrationWrong or expired code.
passkey_refused400POST /passkeysThe device's answer didn't verify. Try the ceremony again.
too_many_passkeys409POST /passkeys/registration, POST /passkeysThe person has as many passkeys as allowed. Remove one first.
passkey_already_registered409POST /passkeysThe passkey is someone else's. One the person already has answers 201.
passkey_not_found404GET and PUT /passkeys/{id}Not one of this person's. DELETE answers 204 either way.

Invitations

CodeStatusWhereMeans, and what to do
flow_not_offered403POST /invitations, POST /invitations/{id}/emailsThe app's account flows are its backend's, so Otoko Identity's invitations aren't offered.
conflict409The sameThe person already has an account in the app, another invitation to the address was just sent (try once more), or the invitation was accepted or revoked and can't be sent again. The reason says which.
app_not_found404POST /invitationsThe app was deleted while the invitation was being made.
invitation_not_found404GET /invitations/{id}, POST /invitations/{id}/emailsAn unknown invitation, or another app's. DELETE answers 204 either way.

Sign-in and sign-up

What Otoko Identity's own pages are told, and so what the person sees there.

CodeStatusMeans, and what to do
app_not_set_up503The client has the email gate on with no roles allowed.
invalid_credentials401A wrong email or password.
code_required403An emailed code is needed first. It has been sent.
wrong_application403Your sign-in check refused the person.
required_action_unavailable503A required action is pending, and none of the app's browser clients has an Action URL to show it. Set one.
unavailable503Your backend didn't answer, and the outage policy is Refuse sign-in.
flow_not_offered403Sign-up, email verification or forgot password isn't offered for this app or client.
sign_up_refused403Your sign-up check said no. Its reason, if it's one of personal_email, domain_taken, account_exists or sign_up_not_offered, comes with it, and the page words it. Any other reason is dropped.
account_exists409A sign-up, with Verify email off, for an address that has an account with another password. The person signs in instead.
field_required422A required sign-up field was left blank. Which one is in field, phone_number or birthdate.
invalid_phone_number422The phone number isn't E.164 once spaces, dashes, dots and brackets are taken out.
invalid_birthdate422The date of birth isn't a date from 1900-01-01 up to today.
link_expired404A set-password or invitation link that's made up, used, expired or revoked. Ask for a new one.

OAuth endpoints

The token, revocation and introspection endpoints answer {"error", "error_description"}, as RFC 6749 says. User info answers {"error"} with a WWW-Authenticate: Bearer header, as RFC 6750 says. The authorization endpoint sends most errors back to your redirect_uri as ?error= with your state.

Authorization

ErrorAnswered asMeans, and what to do
invalid_requestA 400, or the redirectBefore the client is known, a missing or malformed client_id or redirect_uri (a 400). After, a missing response_type, missing or malformed PKCE, PKCE that isn't S256, an unreadable prompt or max_age, or an id_token_hint this issuer didn't sign (the redirect).
invalid_clientA 400An unknown client, a mobile client, or a disabled app.
invalid_redirect_uriA 400redirect_uri isn't exactly on the client's list.
unsupported_response_typeThe redirectOnly response_type=code is offered.
invalid_scopeThe redirectA scope outside openid, profile, email, phone, roles and offline_access.
account_selection_requiredThe redirectprompt=select_account, which has no screen here. Leave it out, or use prompt=login.
request_not_supported, request_uri_not_supportedThe redirectRequest objects aren't offered.
login_requiredThe redirectprompt=none with no usable sign-in: none at all, older than max_age, another person than id_token_hint names, or one the client doesn't offer. Try again without prompt=none.
interaction_requiredThe redirectprompt=none, with a required action to show. Try again without it.
access_deniedThe redirectprompt=none, and your sign-in check said no.
temporarily_unavailableThe redirectprompt=none, and your backend didn't answer. Try again later.

A browser that asks for a page, rather than JSON, goes to Otoko Identity's error page instead of getting a 400.

Token, revocation and introspection

ErrorStatusMeans, and what to do
invalid_request400A form that can't be read, a field sent twice, the client's credentials sent two ways, or no token to revoke or introspect. Over 32 KiB, 413.
invalid_client401An unknown or mobile client, a disabled app, a missing or wrong secret, a secret sent other than the client's authenticator says, a public client sending a secret, or a public client introspecting.
invalid_client429Too many wrong secrets from one address. Wait Retry-After; a right secret still works.
unsupported_grant_type400Not authorization_code, refresh_token or client_credentials.
invalid_grant400A code or refresh token that's wrong, used, expired or another client's, a PKCE verifier or redirect_uri that doesn't match, or a refresh your sign-in check now refuses. Sign in again.
temporarily_unavailable503A refresh of a session let in while your backend was down, and it still can't answer under Refuse sign-in. The session is kept: try the refresh again later.
unauthorized_client400Client credentials from a client that isn't confidential, or has no client credentials scopes.
invalid_scope400Client credentials asking for a scope the client may not have.
unsupported_token_type400Revoking a client credentials token, which can't be revoked and expires on its own. Any other token answers 200.

User info and end session

ErrorStatusMeans, and what to do
invalid_token401User info: no access token, one that doesn't verify, or a session that ended. Refresh it, or sign in again.
insufficient_scope403User info: the sign-in wasn't granted openid.
invalid_request400End session: no client_id or id_token_hint, or ones that don't agree.
invalid_client400End session: client_id isn't a browser client of an enabled app.
invalid_redirect_uri400End session: post_logout_redirect_uri isn't exactly on the client's post-logout list, which is apart from its sign-in redirects.

The error page

When a browser can't go back to your app, it lands on Otoko Identity's error page, at /{language}/error?reason=.

reasonMeans, and what to do
invalid_clientThe client ID is wrong, or its app is disabled.
invalid_redirect_uriThe sign-in or post-logout address isn't on the client's list exactly.
no_appsNo app is set up yet.
unavailableAn outage, of your backend or an identity provider. Try again.
app_not_set_upThe client has the email gate on with no roles allowed.
access_deniedYour sign-in check refused the person, and the page offers to switch account.
required_action_unavailableA required action is pending with no Action URL to show it.
sso_failedA sign-in through an identity provider failed. Check the provider's settings.
sso_sign_up_refusedYour backend made no account for an identity provider's sign-in, or its sign-up check refused one. The reason, one of personal_email, domain_taken, account_exists or sign_up_not_offered, comes as refusal=, and the page words it. With another reason, or none, the page shows sso_failed.
signed_outNot an error: the signed-out page, after an end session with nowhere to go back to.

Saving the app's settings

What the console says when it can't save an app's settings. The console shows the reason, which names the field.

CodeStatusMeans, and what to do
backend_required422The app has no backend address, so its roles can't be its backend's, it can't ask before a sign-up, its account flows can't be its backend's, and it can't allow sign-in when the backend can't be reached.
invalid_backend_url422Not an absolute https address with no query, or its name leads to an address that isn't allowed.
sender_required422The app sends through its own mail server, or tests it, with no From address.
invalid_redirect_uri, invalid_post_logout_redirect_uri, invalid_password_reset_redirect_uri422An address that isn't exact and absolute: https outside a local environment, no wildcard or fragment, a lowercase scheme and host, at most 20.
invalid_action_url422Not an absolute address, or on a mobile client.
invalid_client_settings422A combination that isn't allowed, such as the email gate with no roles allowed, or a mobile client with sign-up or redirect addresses.
invalid_client_credentials_scope422Client credentials scopes only on a confidential client, at most 20, and none of the scopes for people, such as openid or phone.
invalid_passkey_origin422Android passkey origins only on a mobile client, at most 10, each android:apk-key-hash: and an unpadded base64url SHA-256.
passkey_origin_required422A new mobile client with passkeys on needs at least one Android passkey origin.
invalid_required_action422The required actions for new accounts break a rule, or no browser client has an Action URL.
invalid_role422More than 50 roles, one twice, or a role that doesn't start with a letter, is over 40 characters, or has a character other than letters, digits, ., - and _.
roles_owned_by_backend409The app's backend owns its roles, so the console can't remove one, give one, or invite with one.
client_id_taken409Another app has a client with this ID.
app_write_conflict409Someone else saved the app meanwhile. Reload it and save again.
invalid_webhook_secret422A webhook secret must be at least 32 printable characters, random, and not a placeholder.
app_in_use409Deleting an app that has, or had, people or themes, or open invitations. The reason says which. See Troubleshooting.