Auth endpoints
Every endpoint under /auth/v1 and /auth/v1/admin, with what it takes and returns.
All take the project key in apikey. Signed-in calls also send the user’s access token.
Sign-up and sign-in
/auth/v1/signup EngineCloud email password data user_metadata.redirect_to captcha_token Returns the user (unconfirmed), or a session if confirmation is off. Errors: email_exists, email_unconfirmed, invalid_email, weak_password, signup_disabled, email_provider_disabled, captcha_required, 429 rate_limited, and 409 email_provider_required when the sign-up needs an e-mail and the project has no provider (the same answer from otp, recover, reauthenticate, an e-mail change and admin/invite).
/auth/v1/token?grant_type=password EngineCloud email password captcha_token Errors: invalid_credentials, email_not_confirmed, user_banned, captcha_required, 429 rate_limited (also while the account waits after repeated failures).
/auth/v1/token?grant_type=refresh_token EngineCloud refresh_token Errors: invalid_refresh_token, refresh_token_reused, session_expired, session_revoked, invalid_dpop_proof (a refresh token bound to a key). A refresh token of an agent session is renewed at /auth/v1/oauth/token instead (invalid_grant here).
/auth/v1/token?grant_type=pkce EngineCloud auth_code code from the provider redirect.code_verifier A session:
{ "access_token": "eyJ…", "token_type": "bearer", "expires_in": 3600, "expires_at": 1795000000,
"refresh_token": "syp_rt_…", "user": { "id": "7c0e…", "email": "ana@example.com", "email_confirmed_at": "…", "user_metadata": {} } }Links, codes and recovery
| Endpoint | Does |
|---|---|
POST /auth/v1/otp { email, create_user?, data?, redirect_to?, captcha_token? } | e-mails a sign-in link and code; create_user (default true) creates the user when the e-mail is new |
POST /auth/v1/magiclink | the same as /auth/v1/otp |
POST /auth/v1/verify { type, token_hash } or { type, email, token } | checks a link or code; returns a session. type: signup, magiclink, recovery, invite, email_change, email |
GET /auth/v1/verify?token_hash=…&type=…&redirect_to=… | the same from an e-mail link; 303 to redirect_to#access_token=… |
POST /auth/v1/recover { email, redirect_to?, captcha_token? } | e-mails a recovery link; always 200 |
POST /auth/v1/reauthenticate | e-mails a code for a sensitive change, valid 10 minutes; pass it as nonce |
The flows that send an e-mail answer {"status": "sent"}, or 202 with {"status": "email_queued_retry"} when the provider failed and the e-mail is being retried. Without a provider they answer 409 email_provider_required.
The signed-in user
| Endpoint | Does |
|---|---|
GET /auth/v1/user | the user, fresh |
PUT /auth/v1/user { password?, email?, data?, nonce? } | changes; password needs a recent sign-in or nonce |
POST /auth/v1/logout?scope=local|others|global | ends sessions |
GET /auth/v1/sessions, DELETE /auth/v1/sessions/{id} | the person’s devices |
GET /auth/v1/tokens, POST /auth/v1/tokens { name, scopes, resource?, expires_at? }, DELETE /auth/v1/tokens/{id} | personal access tokens; the token comes back once; expires_at: null never expires |
Changing the account (password, e-mail, PATs, sessions, linked identities) needs the person’s own session: a PAT or an app acting for them gets 403 person_required.
Providers
| Endpoint | Does |
|---|---|
GET /auth/v1/authorize?provider=google|github&redirect_to=…&code_challenge=…&code_challenge_method=S256 | starts a provider sign-in |
GET /auth/v1/user/identities/authorize?provider=…&redirect_to=…&code_challenge=… | signed in: links another provider; answers { url } to open; the return gives ?code= for grant_type=pkce |
DELETE /auth/v1/user/identities/{provider} | signed in: unlinks a provider; 422 last_identity when it is the last way to sign in |
GET /auth/v1/callback | where the provider returns; redirects to your app with ?code= |
GET /auth/v1/settings | public: providers (email, google, github), signup_open, require_email_confirmation, password_min_length, password_requirements, captcha, project_name, email_ready |
Admin (secret key)
| Endpoint | Does |
|---|---|
GET /auth/v1/admin/users?search=&page=&per_page= | list and search: { users, total }; per_page 50 by default, up to 1 000 |
POST /auth/v1/admin/users | create (email_confirm, password, user_metadata, app_metadata) |
POST /auth/v1/admin/invite { email, data?, redirect_to? } | creates the user and e-mails an invitation |
GET/PUT/DELETE /auth/v1/admin/users/{id} | read, change (email, password, email_confirm, user_metadata, app_metadata, ban_duration such as 24h, 7d or none), delete |
POST /auth/v1/admin/users/{id}/logout | end every session of the user |
POST /auth/v1/admin/generate_link { type, email, redirect_to? } | a link without sending it, for signup, invite, magiclink or recovery: action_link, email_otp, hashed_token, verification_type |
GET/PATCH /auth/v1/admin/settings | the project’s settings (all of them); GET adds template_defaults, template_variables, mail_state and mail_providers |
GET/POST/PATCH/DELETE /auth/v1/admin/oauth/clients[/{id}] | OAuth clients (client credentials); a secret is shown once |
POST /auth/v1/admin/oauth/registration-tokens { name, scopes?, expires_at? } | an initial access token syp_iat_… for a confidential dynamic registration, shown once |
GET/POST/DELETE /auth/v1/admin/api-keys[/{id}] | API keys; POST takes kind (publishable or secret), name and protected; DELETE of a protected key answers 409 protected_key; revoking the key you are calling with answers 400 not_allowed |
POST /auth/v1/admin/api-keys/{id}/rotate-protected | replaces a protected key: the new key (shown once) and the old one revoked, in one transaction |
POST /auth/v1/admin/keys/rotate | publishes a new signing key: { next_kid }; it signs 24 hours later (signing keys) |
Every admin endpoint needs a secret key (or a service_role token); anything else gets 403 secret_key_required. All error codes: Errors and limits.