Errors
Every error reply from an operation under /v1 is a problem: application/problem+json, as RFC 9457 defines it. There a failure is always a 4xx or 5xx status; a 200 never carries an error. Two groups of paths differ: see Exceptions.
HTTP/1.1 404 Not FoundContent-Type: application/problem+json; charset=utf-8traceparent: 00-0521cd76fe17476a8cfa58304905e6c9-310dc70d19094642-00
{ "error": "not-found", "category": "not-found", "type": "https://docs.voidfs.com/errors/#not-found", "status": 404, "title": "Not found", "instance": "urn:uuid:0521cd76-fe17-476a-8cfa-58304905e6c9"}| Member | Meaning |
|---|---|
error |
The stable error code. Branch on this. |
category |
One of seven groups, for a client that handles kinds of error and not each code: invalid-input, unauthorized, forbidden, not-found, conflict, rate-limited, unavailable. |
type |
A URI for the error code: this page’s address with the code as its fragment, so it opens the code’s row in the table below. |
status |
The HTTP status of the reply. |
title |
A short name for the error code, for people. It is the same for every reply with that code. |
detail |
Sometimes present: what was wrong with this request, such as Unexpected query parameter "page". For people; do not parse it. |
instance |
The request ID, as a UUID URN. |
A reply to HEAD has no content, so it carries the status and the headers only.
Headers on an error
Section titled “Headers on an error”- 401 sends
WWW-Authenticatewith the scheme of each credential the operation accepts:Session,Signature,Bearer. WithSignatureit also sendsAccept-Signature, which names the components to sign. See Authentication. - 405 sends
Allowwith the methods the path accepts. - 429 can send
Retry-After, in seconds.
A client that is too old gets 400 with the error code client-outdated, not 426.
Request ID and tracing
Section titled “Request ID and tracing”The service gives every request one ID, a UUID, and a problem’s instance is that ID: urn:uuid:0521cd76-fe17-476a-8cfa-58304905e6c9. Quote it when you report a problem.
The service also accepts the W3C Trace Context header traceparent and returns one on every reply under /v1, on errors too:
- If the request sent a valid
traceparent, the reply keeps its trace ID and its sampled flag, with a new span ID. - If it sent none, the trace ID is the request ID without its hyphens, as in the example above.
The request ID in instance is the service’s own. It is not the nonce of a signed request, which the app chooses.
Exceptions
Section titled “Exceptions”/auth. Better Auth writes the replies under /auth, so an error from the library has its JSON shape, {"code": "…", "message": "…"}. What the service itself refuses there, such as a wrong origin or an unknown path, is a problem. The reference shows both for each /auth operation.
The paths not yet under /v1. /native/account, /v3/control and /v3/transfer keep their earlier replies until they move: a failure there can be a JSON object with only error and category, or an outcome inside a 200 reply.
Error codes
Section titled “Error codes”error | title | status | category |
|---|---|---|---|
invalid | Invalid request | 400 | invalid-input |
client-outdated | Client update required | 400 | invalid-input |
conflicting-credentials | Conflicting credentials | 400 | invalid-input |
connected-app-unavailable | Connected-app credential unavailable | 401 | unauthorized |
unsupported-media-type | Unsupported media type | 415 | invalid-input |
payload-too-large | Payload too large | 413 | invalid-input |
session | Sign-in required | 401 | unauthorized |
unauthorized | Credentials required | 401 | unauthorized |
forbidden | Not allowed | 403 | forbidden |
origin | Origin not allowed | 403 | forbidden |
not-found | Not found | 404 | not-found |
unknown-link | Unknown link | 404 | not-found |
unknown-account | Unknown account | 404 | not-found |
method-not-allowed | Method not allowed | 405 | invalid-input |
precondition-failed | Precondition failed | 412 | conflict |
range-not-satisfiable | Range not satisfiable | 416 | invalid-input |
rate-limit | Rate limit exceeded | 429 | rate-limited |
setup | Account setup required | 403 | forbidden |
unlock | Passkey proof refused | 403 | forbidden |
account-exists | Account already exists | 409 | conflict |
erasing | Previous account is being erased | 503 | unavailable |
billing | Billing unavailable | 503 | unavailable |
subscriptions | Subscriptions unavailable for this account | 403 | forbidden |
subscribed | Account already subscribed | 409 | conflict |
offer-changed | Offer changed | 409 | conflict |
no-subscription | Account has no subscription | 409 | conflict |
paused | Sign-ups paused | 503 | unavailable |
unavailable | Unavailable | 500 or 503 | unavailable |
An operation’s page in the reference lists the codes it can answer, with an example of each.