Docs

HTTP API: authentication

Sign app users up and in (email and password, magic links, email codes, passkeys, SSO, anonymous), refresh and end sessions, MFA, email changes and a user's own sessions and devices — every request and response.

Updated Nov 25, 2026

Every authentication endpoint with its request, the JSON it returns and its errors. The SDKs wrap these — JavaScript: Authentication, Python: Authentication — and the guides explain the flows: Authentication overview, Sessions and tokens, Multi-factor authentication, Passkeys.

URL=https://<project-ref>.sovarias.in     # your project URL
ANON_KEY=<anon key>                      # Connect › API keys
ACCESS_TOKEN=<access_token from sign-in> # for calls made as a signed-in user
Base URLhttps://<project-ref>.sovarias.in — your project URL from Connect.
KeysSend the project's key as apikey. Calls made for a signed-in user also send Authorization: Bearer <access token>.
ErrorsA status code and {"detail": …} — a sentence, or {code, message} for errors your code may branch on (HTTP API).

#Sign up and sign in

Call these on your project URL with the anon key. A session is an access_token (send it as Authorization: Bearer …) and a refresh_token.

POST/api/v1/auth/register

Create an app user with an email and password.

Creates the account and returns its id — not a session. Sign the user in with POST /api/v1/auth/project/login afterwards (the SDKs' signUp does both). When the project requires email confirmation, a confirmation email is sent and email_verification_required is true: the user can sign in once they confirm.

Sign-up never reveals whether an address already has an account. For a taken address the answer is the same 201 with the same fields (a random id), it takes as long as a real sign-up, no account or session is created, and the address's owner gets a "you already have an account" email with a sign-in link and a one-time password-reset link (at most one an hour). The sign-in that follows only works with that account's own password.

On your project URL the project comes from the host, so org_id and project_id aren't needed.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/signup, /auth/v1/register

Body

namestringoptional
Display name stored on the user.
0–255 characters
emailstringrequired
The user's email address; it becomes their sign-in.
passwordstringrequired
Must meet the project's password rules (Authentication › Settings): length, upper case, digit, special character. Passwords found in known breaches are refused.
at least 8 characters
org_idstring | nulloptional
Only when calling https://api.sovaria.in instead of your project URL.
project_idstring | nulloptional
Only when calling https://api.sovaria.in instead of your project URL.
env_idstring | nulloptional
Sign up in another environment (for example staging).
captcha_tokenstring | nulloptional
The token from the CAPTCHA widget, when CAPTCHA is on for the project.
accept_termsboolean | nulloptional
Console sign-up: the person agreed to the Terms of Service and Privacy Notice (required, never pre-ticked)
age_confirmedboolean | nulloptional
Console sign-up: the person confirmed they are 18 or older
age_groupstring | nulloptional
Console sign-up: 18_plus, or 13_17 with guardian_email (the account waits for the guardian's consent). Under 13 can't sign up.
One of 18_plus, 13_17
guardian_emailstring | nulloptional
Parent's or guardian's email (age_group 13_17)
0–320 characters
product_updatesboolean | nulloptional
Console sign-up: product news by email (optional, off unless chosen)
dataobject | nulloptional
App sign-up: the user's user_metadata (Supabase's signUp options.data), at most 16 KB. Ignored for console accounts.

Returns

node_idstring (uuid)
The new user's id — the same id auth.uid() returns in your policies.
emailstring
The address, lower-cased.
actor_lanestring
product (an app user).
auth_subject_typestring
product_user.
email_verification_requiredboolean
Present and true when the project requires email confirmation before sign-in.

Responses

  • 201Created.
  • 400email sign-ups need the email provider on, or the request is missing the project (org_id is required…).
  • 400CAPTCHA is on for the project and captcha_token is missing or failed.
  • 403SIGNUP_DISABLED — the project only lets invited users in.
  • 422The password breaks a rule or appears in a known data breach.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
curl -s -X POST "$URL/api/v1/auth/register" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name": "Ada Lovelace", "email": "ada@example.com", "password": "Correct-Horse-9!"}'
Response
{
  "node_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
  "email": "ada@example.com",
  "actor_lane": "product",
  "auth_subject_type": "product_user",
  "email_verification_required": true
}

POST/api/v1/auth/project/login

Sign an app user in with email and password.

Returns a session. When the user has two-factor authentication on, mfa_required is true and access_token is a 5-minute challenge token: send it with the user's code to POST /api/v1/auth/mfa/verify to get the real session.

A user belongs to one project: an account from another project or environment gets 401 here.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/project/login

Body

emailstringrequired
The user's email address.
passwordstringrequired
Their password.
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
env_idstring | nulloptional
Sign in to another environment.
captcha_tokenstring | nulloptional
The CAPTCHA widget's token when CAPTCHA is on.

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400CAPTCHA is on for the project and captcha_token is missing or failed.
  • 401Invalid email or password — also for an account of another project.
  • 403The email provider is off for the project, or the account is a console (team) account.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/project/login" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"email": "ada@example.com", "password": "Correct-Horse-9!"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

POST/api/v1/auth/project/anonymous

Sign a visitor in as an anonymous user.

Creates an anonymous app user and returns a session for it, so a visitor can use your app before signing up (their actor.is_anonymous is true in your policies). Turn on Anonymous sign-ins under Authentication › Sign in / Providers first.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/project/anonymous

Body

captcha_tokenstring | nulloptional
0–4,096 characters
gotrue_meta_securityobject | nulloptional

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 403Anonymous sign-in is disabled for this project.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/project/anonymous" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

POST/api/v1/auth/refresh

Exchange a refresh token for a new session.

Each refresh token works once: the response carries a new one, and the old one stops working (reusing it signs the session out, per the project's reuse interval). The SDKs refresh a minute before the access token expires.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/refresh

Body

refresh_tokenstringoptional
The refresh_token from sign-in or the previous refresh. Browsers may send the refresh cookie instead.

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 401Missing, expired, revoked or reused refresh token — sign the user in again.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/refresh" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

POST/api/v1/auth/logout

Sign out: revoke the session's refresh token.

The access token keeps working until it expires (at most 15 minutes by default); drop it from the client. POST /auth/v1/logout is the same call.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/logout

Query parameters

scopestringoptional
0–16 characters

Body

refresh_tokenstring | nulloptional
The session's refresh token, so it can't be used again.

Responses

  • 204Success, with no body.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/logout" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…"}'

GET/api/v1/auth/me

The signed-in user's profile.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/user, /auth/v1/me

Returns

idstring (uuid)
The user's id.
emailstring
email_verifiedboolean
Whether they confirmed their address.
email_verification_requiredboolean
Console accounts only: true until the address is confirmed.
namestring
Display name.
rolesarray<string>
The user's app roles (assigned on the Users page) — what ctx.actor.roles and auth.has_role() see.
actor_lanestring
product for app users.
auth_subject_typestring
org_id, org_name, project_id, project_namestring
The organization and project the session belongs to.
env_id, env_name, env_db_typestring | null
The environment, when the session is for one (null for production).
planstring
The organization's plan.
plan_featuresobject
The plan's main limits, for showing upgrade hints.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/me" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
  "email": "ada@example.com",
  "email_verified": true,
  "email_verification_required": false,
  "name": "Ada Lovelace",
  "roles": [
    "staff"
  ],
  "actor_lane": "product",
  "auth_subject_type": "product_user",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "org_name": "Skolist",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "project_name": "skolist-shop",
  "env_id": null,
  "env_name": null,
  "env_db_type": null,
  "plan": "pro",
  "plan_features": {
    "cli_access": true,
    "sdk_access": true,
    "max_projects": 10,
    "max_team_members": 10,
    "max_storage_gb": 100,
    "max_function_invocations_per_month": 2000000,
    "max_function_duration_sec": 150,
    "max_function_memory_mb": 1024,
    "max_oauth_providers": 20,
    "max_buckets": 100,
    "max_mau_per_month": 100000,
    "max_active_databases": 1,
    "custom_domains": true,
    "realtime_e2ee": true,
    "audit_log_retention_days": 30,
    "priority_support": false
  }
}

GET/api/v1/auth/public-config

The project's public sign-in settings, for building sign-in screens.

No session is needed. Use it to show only the sign-in methods that are on, and to check passwords against the project's rules before submitting.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/public-config

Query parameters

project_idstring | nulloptional
Only when calling https://api.sovaria.in; on your project URL it comes from the host.

Returns

signupobject
Whether sign-up is open, invite-only, needs email confirmation, and whether anonymous sign-ins are on.
providersobject<string, boolean>
Each sign-in method and whether it is on: email, magic_link, phone_otp, github, google, gitlab, microsoft, apple, discord, linkedin, facebook, x_twitter, saml, oidc, custom_jwt.
passwordobject
Password rules: minimum length and required character kinds.
securityobject
captchaEnabled, mfaRequired and leakedPasswordCheck (breached passwords refused).
sessionobject
timeoutMinutes: the inactivity timeout.
projectobject
The project's id, orgId and ref (the <ref> in its URL).
mfaobject
Which second factors are on: totp, phone, and maxFactors.
passkeysobject
Whether passkeys are on, and the relying party id and name.
siteUrlstring | null
Where email links open by default.
ssoarray<object>
Enterprise SSO providers that are on (id, name, preset).
captchaobject
Present when CAPTCHA is set up: provider and the widget's siteKey.

Responses

  • 200Success.
  • 400project_id is required (when not on your project URL).
curl -s "$URL/api/v1/auth/public-config" \
  -H "apikey: $ANON_KEY"
Response
{
  "signup": {
    "enabled": true,
    "inviteOnly": false,
    "emailVerificationRequired": true,
    "anonymous": false
  },
  "providers": {
    "email": true,
    "magic_link": true,
    "phone_otp": false,
    "github": true,
    "google": true,
    "gitlab": false,
    "microsoft": false,
    "apple": false,
    "discord": false,
    "linkedin": false,
    "facebook": false,
    "x_twitter": false,
    "saml": false,
    "oidc": false,
    "custom_jwt": false
  },
  "password": {
    "minLength": 8,
    "requireUppercase": true,
    "requireDigit": true,
    "requireSpecial": true
  },
  "security": {
    "captchaEnabled": false,
    "mfaRequired": false,
    "leakedPasswordCheck": true
  },
  "session": {
    "timeoutMinutes": 60
  },
  "project": {
    "id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
    "orgId": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "ref": "k3v9x2"
  },
  "mfa": {
    "totp": true,
    "phone": false,
    "maxFactors": 10
  },
  "passkeys": {
    "enabled": true,
    "rpId": "k3v9x2.sovarias.in",
    "rpName": "skolist-shop"
  },
  "siteUrl": "https://app.example.com",
  "sso": []
}

POST/api/v1/auth/magic-link/send

Email a sign-in link (and code) to an existing user.

Always answers {"status": "sent"}, whether or not the address has an account, and takes as long either way, so it can't be used to find out who signed up. Only existing, active accounts get an email — a magic link doesn't create an account. The link works once, for 15 minutes.

For links that open a mobile app (custom scheme), send a PKCE code_challenge and keep the verifier until verify (PKCE_REQUIRED otherwise).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/magic-link/send

Body

captcha_tokenstring | nulloptional
The CAPTCHA widget's token when CAPTCHA is on.
0–2,048 characters
emailstringrequired
The user's email address.
create_userbooleanoptionaldefault false
Sign the address up when it has no account yet (passwordless sign-up; Supabase shouldCreateUser). Follows the project's sign-up switch and before-create hook
dataobject | nulloptional
user_metadata for a new user
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
redirect_tostring | nulloptional
Where the link should open — your Site URL, or one of the project's allowed redirect URLs (anything else falls back to the Site URL).
0–2,048 characters
code_challengestring | nulloptional
PKCE S256 challenge, required when redirect_to opens an app.
43–128 characters, pattern `^[A-Za-z0-9_-]+$`

Responses

  • 200Success.
  • 400CAPTCHA is on for the project and captcha_token is missing or failed.
  • 400PKCE_REQUIRED — redirect_to opens an app and no code_challenge was sent.
  • 403Magic links are turned off for the project.
  • 429Too many links for this address or from this IP, or AUTH_RATE_LIMITED.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/magic-link/send" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"email": "ada@example.com", "redirect_to": "https://app.example.com/auth/callback"}'
Response
{
  "status": "sent"
}

POST/api/v1/auth/magic-link/verify

Exchange the token from a magic link for a session.

Opening the link also confirms the user's email address. A link works once.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/magic-link/verify

Body

tokenstringrequired
The token query parameter of the link the user opened.
16–256 characters
code_verifierstring | nulloptional
The PKCE verifier, when the link was sent with a code_challenge.
43–128 characters

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400Invalid or expired magic link, or the PKCE verifier is missing (PKCE_VERIFIER_REQUIRED) or wrong (PKCE_VERIFIER_MISMATCH).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/magic-link/verify" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"token": "mlk_3q2-Xr8…"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

POST/api/v1/auth/magic-link/verify-code

Sign in with the code from a magic-link email instead of the link.

The same email carries a short code, for when the link opens on another device. The code works once, for 15 minutes.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/magic-link/verify-code

Body

emailstringrequired
The address the email was sent to.
codestringrequired
The code from the email.
6–12 characters
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400Invalid or expired magic link — the code is wrong or expired.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/magic-link/verify-code" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"email": "ada@example.com", "code": "482913"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

POST/api/v1/auth/otp/send

Text a one-time sign-in code to a phone number.

Sends an SMS with a code, valid for 5 minutes. Turn on Phone (SMS) codes under Authentication › Sign in / Providers first.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/otp/send

Body

phonestringrequired
The number in E.164 format, for example +15551234567.
8–24 characters
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
env_idstring | nulloptional
Another environment.
captcha_tokenstring | nulloptional
CAPTCHA token when the project has CAPTCHA protection on
0–4,096 characters
create_userbooleanoptionaldefault false
Sign the number up when it has no account yet
dataobject | nulloptional
user_metadata for a new user

Responses

  • 202Accepted — the work continues in the background.
  • 422The number isn't in E.164 format.
  • 429Too many codes requested for this number or network, or AUTH_RATE_LIMITED.
  • 502The SMS provider refused or is unavailable.
curl -s -X POST "$URL/api/v1/auth/otp/send" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"phone": "+15551234567"}'
Response
{
  "status": "accepted"
}

POST/api/v1/auth/otp/verify

Sign in with the code from an SMS.

Signs in the user whose account has this phone number; it doesn't create accounts. A code works once.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/otp/verify

Body

phonestringrequired
The same number the code was sent to.
8–24 characters
codestringrequired
The code from the SMS.
4–12 characters
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
env_idstring | nulloptional
Another environment.

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 401Invalid or expired verification code, or too many wrong attempts (request a new code).
  • 422The number isn't in E.164 format.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
curl -s -X POST "$URL/api/v1/auth/otp/verify" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"phone": "+15551234567", "code": "482913"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

#Passwords and email addresses

POST/api/v1/auth/password-reset/send

Email a password-reset link.

Answers the same, in the same time, whether or not the address has an account. The link opens redirect_to (or the Site URL) with ?token=…&type=recovery and works once, for 15 minutes.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/password-reset/send

Body

captcha_tokenstring | nulloptional
The CAPTCHA widget's token when CAPTCHA is on.
0–2,048 characters
emailstringrequired
The user's email address.
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed.
redirect_tostring | nulloptional
Your page that asks for the new password; must be the Site URL or an allowed redirect URL.
0–2,048 characters
code_challengestring | nulloptional
PKCE S256 challenge, required when redirect_to opens an app.
43–128 characters, pattern `^[A-Za-z0-9_-]+$`

Responses

  • 200Success.
  • 400CAPTCHA is on for the project and captcha_token is missing or failed.
  • 400PKCE_REQUIRED for app redirects without a challenge.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/password-reset/send" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"email": "ada@example.com", "redirect_to": "https://app.example.com/reset-password"}'
Response
{
  "status": "sent"
}

POST/api/v1/auth/password-reset/confirm

Set a new password with the token from the reset email.

The new password must meet the project's rules. Every session the user had is signed out, so they sign in again with the new password.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/password-reset/confirm

Body

tokenstringrequired
The token from the reset link.
16–256 characters
new_passwordstringrequired
The new password.
8–256 characters
code_verifierstring | nulloptional
The PKCE verifier, when the link was sent with a challenge.
43–128 characters

Returns

statusstring
password_updated.
user_idstring (uuid)
Whose password changed.

Responses

  • 200Success.
  • 400Invalid or expired password reset token, a password rule is broken, or the PKCE verifier is missing or wrong.
  • 422The password appears in a known data breach.
curl -s -X POST "$URL/api/v1/auth/password-reset/confirm" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"token": "pwr_9Ft…", "new_password": "Another-Horse-7!"}'
Response
{
  "status": "password_updated",
  "user_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51"
}

POST/api/v1/auth/verify-email/send

Send the signed-in user a new email-confirmation link.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/verify-email/send

Responses

  • 200Success.
  • 429Too many verification emails — try again in an hour.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/verify-email/send" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "sent"
}

POST/api/v1/auth/verify-email/confirm

Confirm an email address with the token from the confirmation link.

The link opens your Site URL with ?token=…&type=signup; post the token here (the SDKs' handleEmailLink() does). Works once; links last 24 hours.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/verify-email/confirm

Body

tokenstringrequired
The token from the confirmation link.
16–256 characters

Returns

statusstring
verified.
user_idstring (uuid)

Responses

  • 200Success.
  • 400Invalid or expired token.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/verify-email/confirm" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"token": "evt_Q2s…"}'
Response
{
  "status": "verified",
  "user_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51"
}

POST/api/v1/auth/email-change/send

Start changing the signed-in user's email address.

Emails a confirmation link to the current address. Step two (confirm) emails the new address; step three (finalize) switches. Nothing changes until all three are done.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/email-change/send

Body

new_emailstringrequired
The address to change to.

Responses

  • 200Success.
  • 400The new address is empty or the same as the current one.
  • 429Too many email-change requests — wait before trying again.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/email-change/send" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"new_email": "ada@newmail.com"}'
Response
{
  "status": "sent"
}

POST/api/v1/auth/email-change/confirm

Confirm the change from the current address; emails the new address.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/email-change/confirm

Body

tokenstringrequired
The token from the email sent to the current address.
16–256 characters

Responses

  • 200Success.
  • 400Invalid or expired token.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/email-change/confirm" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"token": "ecc_7Hk…"}'
Response
{
  "status": "confirmation_sent",
  "new_email": "ada@newmail.com"
}

POST/api/v1/auth/email-change/finalize

Finish the change from the new address.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/email-change/finalize

Body

tokenstringrequired
The token from the email sent to the new address.
16–256 characters

Responses

  • 200Success.
  • 400Invalid or expired token.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/email-change/finalize" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"token": "ecf_2Lp…"}'
Response
{
  "status": "email_updated",
  "user_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
  "email": "ada@newmail.com"
}

#Social sign-in and SSO

Social providers (Google, GitHub, Apple…) start in the browser — the SDKs' signInWithProvider() — and come back to your callback page with a handoff token. SAML connections (Team and up) sign app users in through the company's identity provider: look the connection up by e-mail, send the browser to authorize, and exchange the code it comes back with at POST /api/v1/auth/sso/exchange. The identity provider posts its signed response to the connection's ACS address (POST /api/v1/auth/sso/saml/{connection_id}/acs, in the metadata); it is checked (signature, issuer, audience, recipient, request id, validity window, single use, e-mail domain) before the browser goes back with code, or with error (saml_invalid, saml_replayed, domain_not_allowed, account_exists, signup_refused, plan_required).

POST/api/v1/auth/oauth/handoff

Exchange the one-time handoff token from a social sign-in redirect for a session.

After Google, GitHub or another provider signs the user in, Sovaria redirects to your callback page with a short-lived handoff token. Post it here once (the SDKs' getSessionFromUrl() does).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/oauth/handoff

Body

tokenstringrequired
The handoff token from the callback URL.
at least 1 characters

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400Invalid or expired handoff token — it works once, shortly after the redirect.
  • 403SIGN_IN_STARTED_ELSEWHERE — a console sign-in link only works in the browser that started the sign-in (it carries the sovaria_oauth_nonce cookie set at the start). Start signing in again in this browser.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/oauth/handoff" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"token": "oah_Zm9…"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

GET/api/v1/auth/sso/providers

The project's enterprise SSO (OIDC) providers, for showing their buttons.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/sso/providers

Query parameters

project_idstringrequired
Only when calling https://api.sovaria.in.

Responses

  • 200Success.
curl -s "$URL/api/v1/auth/sso/providers" \
  -H "apikey: $ANON_KEY"
Response
[
  {
    "id": "okta-skolist",
    "name": "Skolist Okta",
    "preset": "okta"
  }
]

GET/api/v1/auth/sso/{provider_id}/authorize

Start an SSO sign-in: redirects to the identity provider.

Open this URL in the browser. With mode=json it answers {"authorization_url": …} instead of redirecting. After the provider signs the user in, they come back to redirect_to with a code to post to POST /api/v1/auth/sso/exchange with the PKCE verifier.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/sso/{provider_id}/authorize

Path parameters

provider_idstringrequired
The provider's id from GET /api/v1/auth/sso/providers.

Query parameters

project_idstringrequired
The project id.
redirect_tostring | nulloptional
0–2,048 characters
code_challengestring | nulloptional
43–128 characters
code_challenge_methodstringoptionaldefault S256
pattern `^S256$`
modestringoptionaldefault redirect
pattern `^(redirect|json)$`

Responses

  • 200Success.
  • 302Without mode=json: a redirect to the identity provider.
  • 400No Site URL is set, redirect_to isn't allowed, or PKCE_REQUIRED for app redirects.
  • 404No such provider for the project.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
curl -s "$URL/api/v1/auth/sso/okta-skolist/authorize?redirect_to=https://app.example.com/sso/callback&code_challenge=E9Melhoa2Owv…&mode=json" \
  -H "apikey: $ANON_KEY"
Response
{
  "authorization_url": "https://skolist.okta.com/oauth2/v1/authorize?client_id=…&state=…"
}

POST/api/v1/auth/sso/exchange

Exchange the code from an SSO redirect for a session.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/sso/exchange

Body

codestringoptional
The code from the callback URL.
0–128 characters
auth_codestring | nulloptional
0–128 characters
code_verifierstring | nulloptional
The PKCE verifier matching the challenge sent to authorize.
43–128 characters

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400Invalid or expired code, or the verifier doesn't match.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/sso/exchange" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"code": "sso_c8T…", "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

GET/api/v1/auth/sso/saml/lookup

Which SAML connection signs in an e-mail address.

For a "Continue with SSO" button: the user types their work e-mail and you look up the connection for its domain. Only enabled connections answer.

Who
Anyone: no key or session is needed.
Also at
/auth/v1/sso/saml/lookup

Query parameters

project_idstringrequired
Your project's id.
emailstringrequired
The address the user typed (only its domain is used).
0–320 characters

Responses

  • 200Success.
  • 404No single sign-on is set up for this e-mail domain.
curl -s "$URL/api/v1/auth/sso/saml/lookup?project_id=f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07&email=ada@acme.com" \
  -H "apikey: $ANON_KEY"
Response
{
  "connection_id": "3c9a7e21-5b4d-4f08-9a6e-1d2c3b4a5f60",
  "name": "Acme Okta"
}

GET/api/v1/auth/sso/saml/{connection_id}/authorize

Start a SAML sign-in: redirects to the company's identity provider.

Open this URL in the browser (the SDKs' signInWithSSO({ email })). The identity provider signs the user in and posts back to the connection's ACS address; the user then lands on redirect_to with a one-time code (type=sso) to exchange at POST /api/v1/auth/sso/exchange with the PKCE verifier. With mode=json it answers {"authorization_url": …} instead of redirecting. Needs the Team plan or higher (res.sso).

Who
Anyone: no key or session is needed.
Also at
/auth/v1/sso/saml/{connection_id}/authorize

Path parameters

connection_idstringrequired
From GET /api/v1/auth/sso/saml/lookup or the console.

Query parameters

project_idstringrequired
Your project's id.
redirect_tostring | nulloptional
Where the user comes back to; must be the Site URL or an allowed redirect URL.
0–2,048 characters
code_challengestring | nulloptional
PKCE S256 challenge; required for app redirects.
43–128 characters
code_challenge_methodstringoptionaldefault S256
Always S256.
pattern `^S256$`
modestringoptionaldefault redirect
redirect (default) or json.
pattern `^(redirect|json)$`

Responses

  • 200Success.
  • 302Without mode=json: a redirect to the identity provider.
  • 400No Site URL is set, redirect_to isn't allowed, or PKCE_REQUIRED for app redirects.
  • 403PLAN_FEATURE_REQUIRED: SAML sign-in needs the Team plan or higher.
  • 404The connection doesn't exist or is turned off.
  • 429AUTH_RATE_LIMITED: too many sign-ins from this address; wait as Retry-After says.
curl -s "$URL/api/v1/auth/sso/saml/3c9a7e21-5b4d-4f08-9a6e-1d2c3b4a5f60/authorize?project_id=f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07&redirect_to=https://app.example.com/sso/callback&code_challenge=E9Melhoa2Owv…&mode=json" \
  -H "apikey: $ANON_KEY"
Response
{
  "authorization_url": "https://acme.okta.com/app/acme_sovaria/exk1a2b3c/sso/saml?SAMLRequest=…&RelayState=…"
}

GET/api/v1/auth/sso/saml/{connection_id}/metadata

The service-provider metadata (XML) to give the identity provider's admin.

Entity ID and ACS address for this connection, as application/samlmetadata+xml. Most identity providers can import it from this URL.

Who
Anyone: no key or session is needed.
Also at
/auth/v1/sso/saml/{connection_id}/metadata

Path parameters

connection_idstringrequired
The connection.

Responses

  • 200Success.
  • 400Not a connection id.
curl -s "$URL/api/v1/auth/sso/saml/3c9a7e21-5b4d-4f08-9a6e-1d2c3b4a5f60/metadata" \
  -H "apikey: $ANON_KEY"

#Two-factor authentication

POST/api/v1/auth/mfa/enroll

Start authenticator-app (TOTP) enrolment for the signed-in user.

Show totp_uri as a QR code (or secret for manual entry) and the backup codes once. Enrolment completes when the user sends their first code to POST /api/v1/auth/mfa/verify.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/enroll

Returns

secretstring
Base32 secret for manual entry.
totp_uristring
otpauth:// URI to render as a QR code.
qr_datastring
Same as totp_uri.
backup_codesarray<string>
One-time recovery codes — shown only now; store them hashed if you keep them.

Responses

  • 200Success.
  • 409MFA already enrolled. Disable first to re-enroll.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/mfa/enroll" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "secret": "JBSWY3DPEHPK3PXP",
  "totp_uri": "otpauth://totp/skolist-shop:ada%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=skolist-shop",
  "qr_data": "otpauth://totp/skolist-shop:ada%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=skolist-shop",
  "backup_codes": [
    "f3Kx9_q2Lw8",
    "Qm7-pT2vX0a",
    "…"
  ]
}

POST/api/v1/auth/mfa/verify

Check a two-factor code: completes enrolment, or upgrades a challenge token to a full session.

Send the challenge access_token from sign-in (or the user's session, to finish enrolment) as the bearer token. A code works once. Five wrong codes in five minutes lock MFA for a while (423).

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/verify

Body

codestringrequired
The 6-digit code from the authenticator app (or a backup code), or the SMS code.
6–32 characters, pattern `^[A-Za-z0-9_-]{6,32}$`
methodstringoptionaldefault totp
totp (default) for the app and backup codes, or phone for SMS codes.

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400MFA isn't enrolled, or phone MFA isn't on; MFA_INVALID_CODE (wrong code) or CODE_ALREADY_USED (wait for the next one).
  • 423MFA_LOCKED — too many wrong codes; wait or sign in again.
  • 429Too many wrong SMS codes.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/mfa/verify" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"code": "482913"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

GET/api/v1/auth/mfa/status

Whether the signed-in user has two-factor authentication on.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/status

Returns

mfa_enabledboolean
Authenticator app (TOTP) is on.
phone_mfa_enabledboolean
SMS codes are on.
enrolled_atstring | null
When TOTP was turned on (ISO 8601).

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/mfa/status" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "mfa_enabled": true,
  "phone_mfa_enabled": false,
  "enrolled_at": "2026-10-02T09:14:07Z"
}

DELETE/api/v1/auth/mfa

Turn off authenticator-app MFA for the signed-in user.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa

Body

totp_codestringrequired
A current code from the authenticator app, to prove it's them.
6–8 characters

Responses

  • 200Success.
  • 400MFA is not enabled.
  • 401Invalid TOTP code or TOTP code already used.
  • 409ORG_MFA_REQUIRED — two-factor is required for this account.
  • 429Too many wrong codes.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X DELETE "$URL/api/v1/auth/mfa" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"totp_code": "482913"}'
Response
{
  "status": "disabled",
  "message": "MFA has been removed"
}

GET/api/v1/auth/mfa/backup-codes

How many unused backup codes the user has left (the codes themselves are never shown again).

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/backup-codes

Returns

unused_countintegerrequired
Count of un-redeemed backup codes
codesarray<string> | nulloptional
Plaintext codes — populated ONLY by the regenerate endpoint. GET returns just the count to avoid surfacing secrets on every poll.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/mfa/backup-codes" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "unused_count": 8,
  "codes": null
}

POST/api/v1/auth/mfa/backup-codes/regenerate

Replace all backup codes with new ones (shown once).

Ten new codes; each works once. The old ones stop working.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/backup-codes/regenerate

Returns

unused_countintegerrequired
Count of un-redeemed backup codes
codesarray<string> | nulloptional
Plaintext codes — populated ONLY by the regenerate endpoint. GET returns just the count to avoid surfacing secrets on every poll.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/mfa/backup-codes/regenerate" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "unused_count": 10,
  "codes": [
    "f3Kx9_q2Lw8",
    "Qm7-pT2vX0a",
    "…"
  ]
}

POST/api/v1/auth/mfa/phone/enroll

Start SMS two-factor: texts a code to the user's phone number.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/phone/enroll

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/mfa/phone/enroll" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "otp_sent",
  "phone_hint": "+1***4567"
}

POST/api/v1/auth/mfa/phone/verify-enrollment

Finish SMS two-factor enrolment with the texted code.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/phone/verify-enrollment

Body

codestringrequired
The code from the SMS.
6–6 characters

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/mfa/phone/verify-enrollment" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"code": "482913"}'
Response
{
  "status": "enrolled",
  "message": "Phone MFA is now enabled for your account"
}

POST/api/v1/auth/mfa/phone/challenge

Text a two-factor code at sign-in (then verify with method: "phone").

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/phone/challenge

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/mfa/phone/challenge" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "otp_sent",
  "phone_hint": "+1***4567",
  "method": "phone"
}

DELETE/api/v1/auth/mfa/phone

Turn off SMS two-factor.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/mfa/phone

Body

codestringrequired
A current SMS code.
6–6 characters

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X DELETE "$URL/api/v1/auth/mfa/phone" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"code": "482913"}'
Response
{
  "status": "disabled",
  "message": "Phone MFA has been disabled"
}

#Passkeys

POST/api/v1/auth/passkeys/register/start

Start registering a passkey for the signed-in user.

Pass options to the browser's navigator.credentials.create() (WebAuthn), then send the result to register/finish.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/passkeys/register/start

Body

namestringoptionaldefault Passkey
A label for the passkey, shown in the user's list ("MacBook").
0–128 characters
noncestring | nulloptional
Reauthentication OTP (POST /auth/reauthenticate) when the session isn't aal2 or fresh
0–12 characters

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/passkeys/register/start" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name": "MacBook"}'
Response
{
  "options": {
    "challenge": "x9H3…",
    "rp": {
      "id": "skolist-shop.sovarias.in",
      "name": "skolist-shop"
    },
    "user": {
      "id": "bmUxOWMw…",
      "name": "ada@example.com",
      "displayName": "Ada Lovelace"
    },
    "pubKeyCredParams": [
      {
        "type": "public-key",
        "alg": -7
      }
    ],
    "timeout": 60000,
    "attestation": "none"
  }
}

POST/api/v1/auth/passkeys/register/finish

Save the passkey the browser created.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/passkeys/register/finish

Body

credentialobjectrequired
The PublicKeyCredential from navigator.credentials.create(), as JSON.
namestringoptionaldefault Passkey
The label.
0–128 characters

Responses

  • 201Created.
  • 400The credential doesn't match the challenge or failed verification.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/passkeys/register/finish" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"credential": {"id": "…", "rawId": "…", "response": {"clientDataJSON": "…", "attestationObject": "…"}, "type": "public-key"}, "name": "MacBook"}'
Response
{
  "passkey_id": "9c1d…",
  "name": "MacBook",
  "created_at": "2026-10-17T11:02:44Z"
}

POST/api/v1/auth/passkeys/authenticate/start

Start a passkey sign-in.

Pass options to navigator.credentials.get(), then send the result with challenge_id to authenticate/finish.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/passkeys/authenticate/start

Body

user_idstring | nulloptional
Optional: limit the allowed passkeys to one user's.
project_idstring | nulloptional
Only when calling https://api.sovaria.in instead of your project URL (like project login)

Responses

  • 200Success.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/passkeys/authenticate/start" \
  -H "apikey: $ANON_KEY"
Response
{
  "challenge_id": "pkc_41b…",
  "options": {
    "challenge": "Yk2…",
    "rpId": "skolist-shop.sovarias.in",
    "timeout": 60000,
    "userVerification": "preferred"
  }
}

POST/api/v1/auth/passkeys/authenticate/finish

Sign in with the passkey assertion.

A passkey sign-in counts as two-factor (aal2).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/passkeys/authenticate/finish

Body

challenge_idstringrequired
From authenticate/start.
credentialobjectrequired
The assertion from navigator.credentials.get(), as JSON.

Responses

  • 200Success.
  • 400The assertion failed verification or the challenge expired.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/passkeys/authenticate/finish" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"challenge_id": "pkc_41b…", "credential": {"id": "…", "response": {"authenticatorData": "…", "clientDataJSON": "…", "signature": "…"}, "type": "public-key"}}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user",
  "aal": "aal2"
}

GET/api/v1/auth/passkeys

The signed-in user's passkeys.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/passkeys

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/passkeys" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "id": "9c1d…",
    "name": "MacBook",
    "aaguid": "adce0002-35bc-c60a-648b-0b25f1f05503",
    "transports": [
      "internal",
      "hybrid"
    ],
    "created_at": "2026-10-17T11:02:44Z",
    "last_used_at": "2026-10-17T12:30:01Z"
  }
]

DELETE/api/v1/auth/passkeys/{passkey_id}

Remove one of the user's passkeys.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/passkeys/{passkey_id}

Path parameters

passkey_idstringrequired
The passkey's id.

Query parameters

noncestring | nulloptional

Responses

  • 204Success, with no body.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/auth/passkeys/<passkey-id>" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

#Sessions, devices and security activity

GET/api/v1/auth/sessions

The signed-in user's active sessions.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/sessions

Returns

idstring
Session id, for DELETE /api/v1/auth/sessions/{session_id}.
devicestring
Browser and OS (or app).
ipstring
last_active_atstring
ISO 8601.
expires_in_secondsinteger
Until the refresh token expires.
currentboolean
true for the session making this request.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/sessions" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "id": "sess_8f2…",
    "device": "Chrome on macOS",
    "ip": "203.0.113.24",
    "last_active_at": "2026-10-17T12:30:01Z",
    "expires_in_seconds": 600391,
    "current": true
  },
  {
    "id": "sess_1c7…",
    "device": "Safari on iPhone",
    "ip": "198.51.100.7",
    "last_active_at": "2026-10-15T08:11:40Z",
    "expires_in_seconds": 412044,
    "current": false
  }
]

DELETE/api/v1/auth/sessions/{session_id}

End one of the user's sessions (it can't refresh any more).

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/sessions/{session_id}

Path parameters

session_idstringrequired
From GET /api/v1/auth/sessions.

Responses

  • 204Success, with no body.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/auth/sessions/<session-id>" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/auth/sessions/revoke-others

Sign the user out everywhere except this session.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/sessions/revoke-others

Body

refresh_tokenstring | nulloptional
0–8,192 characters

Responses

  • 204Success, with no body.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/sessions/revoke-others" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/auth/devices

The user's devices: sessions grouped by device, with app version.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/devices

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/devices" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "devices": [
    {
      "device_id": "d_5a1…",
      "platform": "ios",
      "name": "Ada's iPhone",
      "app_version": "2.4.0",
      "user_agent": "SkolistShop/2.4.0 CFNetwork",
      "ip": "198.51.100.7",
      "last_active_at": "2026-10-15T08:11:40Z",
      "session_ids": [
        "sess_1c7…"
      ],
      "current": false
    }
  ]
}

DELETE/api/v1/auth/devices/{device_id}

Sign a device out: ends its sessions and removes its push tokens.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/devices/{device_id}

Path parameters

device_idstringrequired
From GET /api/v1/auth/devices.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/auth/devices/<device-id>" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "sessions_ended": 1,
  "push_tokens_removed": 1
}

GET/api/v1/auth/security/activity

The user's recent security events: sign-ins, password and two-factor changes, devices.

Who
A signed-in app user: Authorization: Bearer <access token>, plus the project's apikey.
Also at
/auth/v1/security/activity

Query parameters

limitintegeroptionaldefault 30
How many events (newest first).
1–100

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/security/activity" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "events": [
    {
      "event": "auth.login",
      "title": "Signed in",
      "at": "2026-10-17T12:29:58Z",
      "ip": "203.0.113.24",
      "device": "Chrome on macOS",
      "method": "Password",
      "risk": false
    },
    {
      "event": "auth.login.failed",
      "title": "Failed sign-in",
      "at": "2026-10-17T12:29:31Z",
      "ip": "203.0.113.24",
      "device": "Chrome on macOS",
      "method": "Password",
      "risk": true
    }
  ]
}

#Realtime tickets and token keys

POST/api/v1/auth/ws-ticket

Get a one-time ticket to open a realtime connection to a channel.

Open wss://<project-ref>.sovarias.in/api/v1/rt/ws/<channel>?ticket=… within expires_in seconds (60); a ticket works once. The ticket's project comes from who you are, never from the request: an app user's or API key's ticket is for its own project, and a team member gets one only for a project they are on (with their role on it). A different org_id/project_id/env_id is refused. Your rules decide when the connection opens whether the caller may subscribe — a refusal closes it with 4401/4408. The SDKs do all of this for you.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/ws-ticket

Body

channelstringrequired
The channel to connect to.
1–128 characters
org_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed. If sent, they must name the caller's own project.
project_idstring | nulloptional
On your project URL the project comes from the host, so org_id and project_id aren't needed. If sent, they must name the caller's own project.
env_idstring | nulloptional
Another environment of the same project.

Returns

ticketstringrequired
at least 16 characters
expires_inintegerrequired
30.0–60.0
token_typestringoptionaldefault websocket-ticket
One of websocket-ticket

Responses

  • 200Success.
  • 400No project scope (call it on your project URL).
  • 403The project isn't yours: an API key or app user of another project, a team member who isn't on this project, or org_id/env_id that don't belong to it.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/ws-ticket" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"channel": "room-42"}'
Response
{
  "ticket": "wst_mF3…",
  "expires_in": 60,
  "token_type": "websocket-ticket"
}

GET/api/v1/auth/jwks

The public keys (JWKS) to verify the project's access tokens in your own backend.

Also at https://<project-ref>.sovarias.in/auth/v1/.well-known/jwks.json. Tokens are ES256; pick the key by the token's kid, cache the set and refetch on an unknown kid.

Who
Anyone: no key or session is needed.
Also at
/auth/v1/jwks

Responses

  • 200Success.
curl -s "$URL/api/v1/auth/jwks" \
  -H "apikey: $ANON_KEY"
Response
{
  "keys": [
    {
      "kty": "EC",
      "crv": "P-256",
      "kid": "prj-1",
      "use": "sig",
      "alg": "ES256",
      "x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
      "y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"
    }
  ]
}

#Console sign-in and CAPTCHA

POST/api/v1/auth/console/login

Sign a team member in to the console (not for app users).

Used by the console and sov login --email. App users sign in with POST /api/v1/auth/project/login. Production asks for a CAPTCHA (GET /api/v1/auth/console-captcha).

Who
Anyone: no key or session is needed.
Also at
/auth/v1/token, /auth/v1/console/login

Body

emailstringrequired
Login email address
passwordstringrequired
Plaintext password
org_idstring | nulloptional
Optional organization UUID for tenant-scoped login
project_idstring | nulloptional
Optional project UUID for project-sandboxed login
env_idstring | nulloptional
Optional environment UUID used to validate the requested scope chain
captcha_tokenstring | nulloptional
hCaptcha / Turnstile response token when CAPTCHA is required

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 400CAPTCHA is on for the project and captcha_token is missing or failed.
  • 401Wrong email or password.
  • 403The account belongs to an app project, not the console.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/console/login" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"email": "you@company.com", "password": "…", "captcha_token": "…"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "console",
  "auth_subject_type": "console_member"
}

POST/api/v1/auth/login

Sign in to the console or a project, depending on the scope sent.

With a project scope (headers or org_id/project_id) this is the same as project/login; without one, the same as console/login. Prefer the explicit routes.

Who
Anyone: no key or session is needed.
Also at
/auth/v1/login

Body

emailstringrequired
Login email address
passwordstringrequired
Plaintext password
org_idstring | nulloptional
Optional organization UUID for tenant-scoped login
project_idstring | nulloptional
Optional project UUID for project-sandboxed login
env_idstring | nulloptional
Optional environment UUID used to validate the requested scope chain
captcha_tokenstring | nulloptional
hCaptcha / Turnstile response token when CAPTCHA is required

Returns

access_tokenstring
The access token (a JWT). Send it as Authorization: Bearer <access_token>. Lasts expires_in seconds (15 minutes by default).
refresh_tokenstring | null
Exchange it for a new pair with POST /api/v1/auth/refresh (7 days by default; each use returns a new one). null when mfa_required is true.
token_typestring
Always bearer.
expires_ininteger
Seconds until access_token expires.
mfa_requiredboolean
true when the user has two-factor authentication on: access_token is then a 5-minute challenge token that only works with POST /api/v1/auth/mfa/verify.
actor_lanestring
product for app users, console for your team.
auth_subject_typestring
product_user for app users, console_member for your team.

Responses

  • 200Success.
  • 401Wrong email or password.
  • 429AUTH_RATE_LIMITED — too many requests from this address or IP; the message says how long to wait (Retry-After).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/login" \
  -H "apikey: $ANON_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"email": "ada@example.com", "password": "Correct-Horse-9!"}'
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJzdWIiOiI2ZTE5YzBhMi0…",
  "refresh_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InByai0xIn0.eyJ0eXAiOiJyZWZyZXNoIi…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

GET/api/v1/auth/console-captcha

Whether console sign-in asks for a CAPTCHA, and the widget's site key.

Who
Anyone: no key or session is needed.
Also at
/auth/v1/console-captcha

Responses

  • 200Success.
curl -s "$URL/api/v1/auth/console-captcha" \
  -H "apikey: $ANON_KEY"
Response
{
  "required": true,
  "provider": "turnstile",
  "siteKey": "0x4AAAAAAA…"
}

GET/api/v1/auth/captcha-config

The project's CAPTCHA settings (the secret key is never returned).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.
Also at
/auth/v1/captcha-config

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/captcha-config" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "captchaProvider": "turnstile",
  "captchaSiteKey": "0x4AAAAAAA…"
}

PUT/api/v1/auth/captcha-config

Set the project's CAPTCHA provider and keys.

Then turn on CAPTCHA protection under Authentication › Attack protection.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.
Also at
/auth/v1/captcha-config

Body

captchaProviderstring | nulloptional
turnstile or hcaptcha.
captchaSiteKeystring | nulloptional
The public site key for the widget.
captchaSecretKeystring | nulloptional
The secret key; stored encrypted, never returned.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/auth/captcha-config" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"captchaProvider": "turnstile", "captchaSiteKey": "0x4AAAAAAA…", "captchaSecretKey": "0x4AAAAAAA…secret"}'
Response
{
  "captchaProvider": "turnstile",
  "captchaSiteKey": "0x4AAAAAAA…"
}

#OAuth 2.1 server (sign in with your project)

GET/oauth/authorize

OAuth 2.1 authorization endpoint for third-party apps that sign in with your project (Sign in with Skolist).

Shows a sign-in and consent page; on success redirects to redirect_uri with ?code=…&state=…. Register the app under Authentication › OAuth apps first. PKCE (S256) is required. AI assistants (client_id mcp_… or an https metadata-document URL) go to the console's consent page instead, where a member picks an organization, project and access — see HTTP API: AI assistants (MCP) and Connect AI assistants (MCP): Claude, ChatGPT, Cursor and VS Code.

Who
Anyone: no key or session is needed.

Query parameters

response_typestringrequired
client_idstringrequired
redirect_uristringrequired
code_challengestringrequired
statestringoptional
code_challenge_methodstringoptionaldefault S256

Responses

  • 200An HTML sign-in and consent page; then a 302 redirect to redirect_uri?code=…&state=….
  • 302Redirect to redirect_uri with code and state after the user agrees.
  • 400Unknown client, redirect URI not registered for it, or missing PKCE.
curl -s "$URL/oauth/authorize?response_type=code&client_id=sov_3f9a1c0b7e2d4a6f8c1e&redirect_uri=https://partner.example.com/callback&code_challenge=E9Melhoa2Owv…&code_challenge_method=S256&state=xyz" \
  -H "apikey: $ANON_KEY"

POST/oauth/authorize

The consent form's submit target (posted by the page from GET /oauth/authorize).

Who
Anyone: no key or session is needed.

Responses

  • 200A 302 redirect to redirect_uri?code=…&state=… (or the form again with an error).
  • 302Redirect to redirect_uri with code and state.
curl -s -X POST "$URL/oauth/authorize" \
  -H "apikey: $ANON_KEY"

POST/oauth/token

Exchange an authorization code (with the PKCE verifier) for tokens.

Form-encoded body: grant_type=authorization_code, code, redirect_uri, client_id, code_verifier (and client_secret for confidential clients). Codes last 5 minutes and work once. Apps get an opaque token valid for 5 minutes that only works at GET /oauth/userinfo — never the person's session. For AI assistants (mcp_… or URL client ids): authorization_code (add resource=https://api.sovaria.in/mcp) returns a 1-hour sov_mcp_ access token and a 30-day sov_mcpr_ refresh token; grant_type=refresh_token with refresh_token and client_id rotates them (an old refresh token used again ends the connection). Errors are OAuth's {error, error_description}.

Who
Anyone: no key or session is needed.

Responses

  • 200Success.
  • 400invalid_grant — the code is wrong, expired, used, or the verifier doesn't match.
curl -s -X POST "$URL/oauth/token" \
  -H "apikey: $ANON_KEY"
Response
{
  "access_token": "q3Zr8Kx…(43 characters, opaque)",
  "token_type": "Bearer",
  "expires_in": 300,
  "scope": "openid profile email"
}

GET/oauth/userinfo

OpenID Connect userinfo for an access token from /oauth/token.

Who
Bearer token from /oauth/token.

Responses

  • 200Success.
curl -s "$URL/oauth/userinfo" \
  -H "apikey: $ANON_KEY"
Response
{
  "sub": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
  "email": "ada@example.com",
  "email_verified": true,
  "name": "ada"
}

#Privacy and consent (console accounts)

A Sovaria console account's consents under India's DPDP Act: the Terms and Privacy Notice it accepted (with version), product e-mail, and for 13–17 year olds a parent's or guardian's consent. Every change is kept as history and is in the account's data download.

GET/api/v1/auth/me/privacy

Your consents, the current notice version and whether you must accept it.

consent_required is true until the current Terms and Privacy Notice are accepted and the age is confirmed (or, for 13–17, a guardian agreed). age_status is adult, minor_pending, minor_approved or unknown.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.
Also at
/auth/v1/user/privacy, /auth/v1/me/privacy

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/me/privacy" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "notice_version": "2026-10-25",
  "consent_required": false,
  "age_status": "adult",
  "consents": {
    "terms": {
      "granted": true,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    },
    "adult": {
      "granted": true,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    },
    "product_updates": {
      "granted": false,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    }
  },
  "product_updates": false,
  "guardian_request": null,
  "wards": [],
  "history": [
    {
      "purpose": "terms",
      "granted": true,
      "notice_version": "2026-10-25",
      "source": "signup",
      "at": "2026-10-25T08:01:12Z"
    }
  ]
}

POST/api/v1/auth/me/privacy/guardian

Send the guardian's consent request again (13–17 accounts waiting for it).

A new link (valid 7 days) replaces the previous one. At most 5 a day.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.
Also at
/auth/v1/user/privacy/guardian, /auth/v1/me/privacy/guardian

Body

guardian_emailstringrequired
The parent's or guardian's address.
3–320 characters

Responses

  • 200Success.
  • 409Only an account waiting for a guardian's consent can ask for it.
  • 422GUARDIAN_EMAIL_IS_YOURS, or no address.
  • 429Too many requests today. Try again tomorrow.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/me/privacy/guardian" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"guardian_email": "parent@example.com"}'
Response
{
  "notice_version": "2026-10-25",
  "consent_required": true,
  "age_status": "minor_pending",
  "consents": {
    "terms": {
      "granted": true,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    },
    "adult": {
      "granted": true,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    },
    "product_updates": {
      "granted": false,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    }
  },
  "product_updates": false,
  "guardian_request": {
    "guardian_email": "parent@example.com",
    "status": "pending",
    "requested_at": "2026-10-25T08:00:00+00:00",
    "expires_at": "2026-11-01T08:00:00+00:00",
    "decided_at": null
  },
  "wards": [],
  "history": [
    {
      "purpose": "terms",
      "granted": true,
      "notice_version": "2026-10-25",
      "source": "signup",
      "at": "2026-10-25T08:01:12Z"
    }
  ]
}

POST/api/v1/auth/me/privacy/wards/{minor_id}/withdraw

As a guardian, withdraw the consent you gave for a young person.

Their account goes back on hold and their sessions end. You find their id in wards of GET /api/v1/auth/me/privacy.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.
Also at
/auth/v1/user/privacy/wards/{minor_id}/withdraw, /auth/v1/me/privacy/wards/{minor_id}/withdraw

Path parameters

minor_idstringrequired
The young person's user id.

Responses

  • 200Success.
  • 404You haven't given consent for this account.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/me/privacy/wards/9b1d0c7f-2e8a-4d51-6e19-c0a23f5b4a8e/withdraw" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "notice_version": "2026-10-25",
  "consent_required": false,
  "age_status": "adult",
  "consents": {
    "terms": {
      "granted": true,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    },
    "adult": {
      "granted": true,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    },
    "product_updates": {
      "granted": false,
      "notice_version": "2026-10-25",
      "at": "2026-10-25T08:01:12Z",
      "source": "signup"
    }
  },
  "product_updates": false,
  "guardian_request": null,
  "wards": [],
  "history": [
    {
      "purpose": "terms",
      "granted": true,
      "notice_version": "2026-10-25",
      "source": "signup",
      "at": "2026-10-25T08:01:12Z"
    }
  ]
}

POST/api/v1/auth/guardian-consent/{token}

Agree or decline as the parent or lawful guardian.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.
Also at
/auth/v1/guardian-consent/{token}

Path parameters

tokenstringrequired
From the link in the e-mail.

Body

approvebooleanrequired
true to agree, false to decline.
relationshipstringrequired
parent or legal_guardian.
One of parent, legal_guardian

Responses

  • 200Success.
  • 403As for reading the request (GUARDIAN_EMAIL_MISMATCH, GUARDIAN_MUST_BE_ADULT).
  • 404This consent link isn't valid any more.
  • 410The link expired.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/guardian-consent/gc_2f7…" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"approve": true, "relationship": "parent"}'
Response
{
  "status": "approved"
}

#Linked apps

Move a signed-in person between apps an organization linked (Organization › Linked apps). The TypeScript SDK runs all three steps for you with auth.openLinkedApp(); see Linked apps (sign in once across your apps).

POST/api/v1/auth/linked/start

Step 1: ask a linked app to sign this person in here.

Call on this app's project URL with its anon key, from the page the person should land on. Make a PKCE verifier first and keep it in the tab (sessionStorage); send its S256 challenge. Production environments only.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/linked/start

Body

source_project_idstringrequired
source_urlstringrequired
8–2,000 characters
return_urlstringrequired
8–2,000 characters
code_challengestringrequired
43–128 characters

Returns

request_idstring
Single use, 5 minutes. Keep the verifier under this id.
urlstring
The other app's address with the request in the fragment: send the browser there.
expires_ininteger
Seconds the request stays valid (300).

Responses

  • 200Success.
  • 400LINKED_NOT_ALLOWED: the apps aren't linked, or an address isn't one of its app's addresses (one answer for both).
  • 403LINKED_PRODUCTION_ONLY: called on a staging or branch environment.
  • 429AUTH_RATE_LIMITED: too many requests from this address; wait and retry (Retry-After).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/linked/start" \
  -H "apikey: $ANON_KEY"
Response
{
  "request_id": "x0LkT9…",
  "url": "https://store.example.com/#sovaria_link_request=x0LkT9…",
  "expires_in": 300
}

POST/api/v1/auth/linked/handoff

Step 2: turn a linked app's request into a one-time code for the signed-in person.

Call on the app the person is signed in to, with their own access token (an app user's session; not a guest, a console member, an AI assistant or a staging token).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/linked/handoff

Body

request_idstringrequired
20–200 characters

Returns

urlstring
Where to send the browser: the other app's address with the code in the fragment.
expires_ininteger
Seconds the code stays valid (60, single use).

Responses

  • 200Success.
  • 400LINKED_REQUEST_INVALID: expired, already used or made for another app; LINKED_REDIRECT_NOT_ALLOWED: the return address is no longer the other app's.
  • 403LINKED_APP_USER_ONLY, LINKED_ANONYMOUS, LINKED_PRODUCTION_ONLY or LINKED_NOT_LINKED.
  • 429AUTH_RATE_LIMITED: too many requests from this address; wait and retry (Retry-After).
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/linked/handoff" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "url": "https://admin.example.com/orders#sovaria_handoff=Qm9…&sovaria_link=x0LkT9…",
  "expires_in": 60
}

POST/api/v1/auth/linked/exchange

Step 3: exchange the code and the tab's PKCE verifier for this app's session.

Call on this app's project URL with its anon key. Returns this app's own session for the person: their linked account, else the account with the same verified email, else a new one when the group allows it and this app takes new sign-ups.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/linked/exchange

Body

codestringrequired
20–200 characters
code_verifierstringrequired
43–128 characters

Returns

access_tokenstring
This app's access token (signed with its own key; refused on every other app).
refresh_tokenstring | null
This app's refresh token.
mfa_requiredboolean
true when the account has two-factor authentication: finish with the MFA challenge as after a password sign-in.

Responses

  • 200Success.
  • 400LINKED_HANDOFF_INVALID: expired, used, made for another app or address, or the verifier doesn't match.
  • 403LINKED_NOT_LINKED, LINKED_ACCOUNT_DISABLED, LINKED_PRODUCTION_ONLY or SIGNUP_DISABLED.
  • 429AUTH_RATE_LIMITED: too many requests from this address; wait and retry (Retry-After).
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/linked/exchange" \
  -H "apikey: $ANON_KEY"
Response
{
  "access_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6InAuOWY0Yy4uLiJ9.eyJzdWIiOiI0YjFk…",
  "refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjoicmVmcmVzaCJ9…",
  "token_type": "bearer",
  "expires_in": 900,
  "mfa_required": false,
  "actor_lane": "product",
  "auth_subject_type": "product_user"
}

#More endpoints

PATCH/api/v1/auth/me

Update your own metadata, email or password (anonymous users: become permanent).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/user, /auth/v1/me

Body

dataobject | nulloptional
user_metadata to merge (null removes a key)
emailstring | nulloptional
passwordstring | nulloptional
1–256 characters
current_passwordstring | nulloptional
0–256 characters
noncestring | nulloptional
OTP from POST /auth/reauthenticate
0–12 characters
email_redirect_tostring | nulloptional
0–2,048 characters

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X PATCH "$URL/api/v1/auth/me" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/auth/mfa/factors

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/factors, /auth/v1/mfa/factors

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/auth/mfa/factors" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/auth/mfa/factors

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/factors, /auth/v1/mfa/factors

Body

factor_typestringrequired
pattern `^(totp|phone|webauthn)$`
friendly_namestring | nulloptional
0–128 characters
phonestring | nulloptional
E.164 number for a phone factor
0–24 characters
issuerstring | nulloptional
0–64 characters

Responses

  • 201Created.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/mfa/factors" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

DELETE/api/v1/auth/mfa/factors/{factor_id}

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/factors/{factor_id}, /auth/v1/mfa/factors/{factor_id}

Path parameters

factor_idstringrequired

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/auth/mfa/factors/<factor_id>" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/auth/mfa/factors/{factor_id}/challenge

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/factors/{factor_id}/challenge, /auth/v1/mfa/factors/{factor_id}/challenge

Path parameters

factor_idstringrequired

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/auth/mfa/factors/<factor_id>/challenge" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/auth/mfa/factors/{factor_id}/verify

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/factors/{factor_id}/verify, /auth/v1/mfa/factors/{factor_id}/verify

Path parameters

factor_idstringrequired

Body

challenge_idstringrequired
8–64 characters
codestring | nulloptional
0–16 characters
credentialobject | nulloptional
WebAuthn PublicKeyCredential JSON

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/mfa/factors/<factor_id>/verify" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/auth/oauth/handoff/peek

Who a handoff would sign in, without using it (DA-I1): the console asks "Sign in as X?" before replacing a session that belongs to someone else. Only the browser that started the sign-in gets an answer.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/auth/v1/oauth/handoff/peek

Body

tokenstringrequired
One-time OAuth handoff token
at least 1 characters

Responses

  • 200Success.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/auth/oauth/handoff/peek" \
  -H "apikey: $ANON_KEY"

POST/oauth/authorize/mfa

Second step of the hosted sign-in: an authenticator or backup code for the pending request.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.

Responses

  • 200Success.
curl -s -X POST "$URL/oauth/authorize/mfa" \
  -H "apikey: $ANON_KEY"