Skip to content

unauthenticated

Returned as
The problem's code
HTTP status
401 Unauthorized
type
https://zautha.com/docs/errors/unauthenticated
  • Backend API: the Authorization: Bearer sk_… header is missing, or the secret key is not a key of any instance (mistyped, deleted or revoked).
  • Frontend API: the request needs a signed-in session and the browser has none (it signed out, or the session ended or expired).
  • Your own backend: @zautha/nextjs, @zautha/backend and Zautha.AspNetCore answer a protected API route with this code when the request has no valid session token. They write the same body Zautha does.

On the server, send the instance’s current secret key from the dashboard (API keys). In the browser, ask the user to sign in again; the SDK clears its state when the session is gone.