Flares Developer Docs

Auth API

Sign-up to sign-out, plus the secret-key admin endpoints.

Base: https://cloud.flaresinc.com/v1/projects/{project}/auth. Every endpoint needs a project key; the ones marked secret refuse a public key. All of them 404 while Auth is not enabled for the project.

Client endpoints (public key)

MethodPathBodyReturns
POST/signupemail, password, display_name?Session (201)
POST/signinemail, passwordSession
POST/otp/requestemail{sent:true} — always
POST/otp/redeememail, codeSession
POST/refreshrefresh_tokenSession (rotated)
POST/signoutrefresh_token{signed_out:true}
POST/signout-all— (access token header){signed_out:true, everywhere:true}
GET/user— (access token header){user}
POST/verify/request— (access token header){sent:true}
POST/verify/confirmtoken{verified:true, user}
POST/password/forgotemail{sent:true} — always
POST/password/resettoken, password{reset:true}

The session object

{
  "user": { "id": "usr_…", "email": "aisha@example.com", "email_verified": false,
            "display_name": null, "photo_url": null, "status": "active",
            "has_password": true, "metadata": {}, "last_sign_in_at": "…", "created_at": "…" },
  "access_token": "eyJ…",
  "expires_at": "2026-09-09T18:00:00+00:00",
  "expires_in": 3600,
  "refresh_token": "frt_…"
}

Send access_token as X-Flares-User-Token (Auth, Functions) or X-Basket-User-Token (Basket). Store refresh_token securely — and replace it on every refresh. Rotation →

Worked example

curl -X POST -H 'Authorization: Bearer basket_public_…' -H 'Content-Type: application/json' \
  -d '{"email":"aisha@example.com","password":"a-strong-passphrase"}' \
  https://cloud.flaresinc.com/v1/projects/prj_…/auth/signin

# 200 → session
# 401 { "error": "unauthorized", "message": "Those credentials did not match." }
#     — the same answer for a wrong password, an unknown email and a disabled account

Admin endpoints (secret key)

MethodPathDoes
GET/users?search=&limit=&offset=List the pool with a total.
POST/usersCreate a user (email, password?, display_name?, email_verified?).
PATCH/users/{user}{status:"active"|"disabled"}. Disabling also revokes their sessions.
DELETE/users/{user}Delete the identity.
POST/users/{user}/revoke-sessionsSign them out everywhere.
POST/users/{user}/send-resetEmail a reset link.
No endpoint returns a password or a hash, in any form, for any key. Security model →