N1 APIDemo shop

REFERENCE

Errors

Every error has the same body and a stable code. Branch on the code; the message is for developers.

{ "code": "UNAUTHENTICATED", "message": "Sign in again.", "requestId": "0192f0c1-7a3e-7c11-9f0e-5b2d8c1e4a90" }
CodeHTTPMessageWhen
BAD_REQUEST400The request could not be read.Malformed JSON, a bad URL, or any other 4xx the framework raises without a more specific code.
VALIDATION_FAILED400The request has invalid fields.Input failed Zod or route schema validation. `details` lists each field path and problem.
GRAPHQL_INVALID400The GraphQL document is invalid.The query does not parse or does not match the schema (unknown field, wrong argument type). The GraphQL `message` says which.
UNAUTHENTICATED401Sign in again.No session, or the token is missing, expired or invalid.
FORBIDDEN403You do not have access to this.Signed in, but the role or tenant does not allow the action.
NOT_FOUND404Not found.Unknown route, or the record does not exist in this tenant.
CONFLICT409This changed since you loaded it.A write lost an optimistic-lock race, or an idempotency key was reused with a different body.
METHOD_NOT_ALLOWED405This method is not allowed here.A GraphQL endpoint was called with anything but POST.
PAYLOAD_TOO_LARGE413The request is too large.The body is over the route limit.
UNSUPPORTED_MEDIA_TYPE415This content type is not supported.The `content-type` header names a type the route does not parse.
QUERY_TOO_COMPLEX400This request asks for too much at once.A GraphQL operation is deeper than 8 levels, costs more than its audience allows, or has more than 2,000 tokens. `details` gives the depth and cost against their limits. Ask for fewer fields or a smaller page.
QUERY_TIMEOUT503This took too long.An operation did not finish its database work within 5 s. Its work is cancelled, but a write may already have committed: retry a mutation only with the same idempotency key.
RATE_LIMITED429Too many requests. Try again shortly.The caller went over a rate limit.
INTERNAL500Something went wrong on our side.Any error Core did not expect. The cause is logged with the request id; the response never carries it.