Account and sign-in endpoints

Sign-in, registration, MFA, single sign-on, onboarding and personal API tokens. Paths are relative to the address of your Simcha DB Studio server.

These endpoints are never available through the MCP server: Signing in, sessions, passwords, MFA, single sign-on and API tokens are kept out of AI clients.

MethodPathWhat it does
GET/api/auth/setup-statusCheck whether the first account is needed
POST/api/auth/setup-adminCreate the first administrator
POST/api/auth/loginSign in with email and password
POST/api/auth/registerCreate a user with a password
GET/api/auth/password-policyShow the password rule
POST/api/auth/request-resetRequest a password reset email
POST/api/auth/reset-passwordSet a new password with a reset token
GET/api/auth/meGet the signed-in user
GET/api/auth/sessionCheck whether this browser is signed in
POST/api/auth/logoutSign out
GET/api/auth/usersList all users
PUT/api/auth/users/:id/roleChange the role of a user
DELETE/api/auth/users/:idDeactivate a user
POST/api/auth/verifyCheck a session token
POST/api/auth/mfa/verifyFinish sign-in with an MFA code
POST/api/auth/mfa/setupStart MFA enrollment
POST/api/auth/mfa/enableTurn on MFA
POST/api/auth/mfa/disableTurn off MFA
GET/api/auth/mfa/statusShow whether MFA is on
GET/api/auth/tokensList your personal API tokens
POST/api/auth/tokensCreate a personal API token
DELETE/api/auth/tokens/:idRevoke a personal API token
POST/api/onboarding/provision-userInvite a user
GET/api/onboarding/approveApprove a sign-up from an approval link
POST/api/onboarding/resend-inviteResend an invitation
GET/api/auth/idp/saml/loginStart SAML sign-in
POST/api/auth/idp/saml/callbackReceive the SAML sign-in response
GET/api/auth/idp/oidc/loginStart OpenID Connect sign-in
GET/api/auth/idp/oidc/callbackReceive the OpenID Connect sign-in response
POST/api/auth/idp/ldap/loginSign in with LDAP
GET/api/auth/idp/statusShow which sign-in methods are on
GET/api/auth/idp/configGet the single sign-on settings
PUT/api/auth/idp/configChange the single sign-on settings

GET /api/auth/setup-status

Reports whether any user exists yet: needsSetup is true and userCount is 0 on a new installation. No sign-in is needed.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

POST /api/auth/setup-admin

Creates the first administrator account and returns it with a session token. Refused once any user exists, and when the password breaks the password rule.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
email (body)string, requiredThe administrator email address
password (body)string, requiredThe password. It must meet the password rule shown by account_password_policy
name (body)string, requiredThe administrator name

POST /api/auth/login

Checks the email and password, sets the session cookie and returns the user, the session expiry and, unless the request comes from the browser app, a session token; when the account uses MFA it returns mfaRequired and an mfaToken instead, to finish with account_mfa_verify. Wrong passwords count toward the account lockout. Locked accounts, accounts that use single sign-on, users without a seat, and non-administrators while password sign-in is limited to administrators are refused.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
email (body)string, requiredThe account email address
password (body)string, requiredThe account password

POST /api/auth/register

Creates an active user who signs in with a password. Refused when the email is already used, no seat is free or the password breaks the password rule. Only a session token is accepted; personal API tokens are refused.

Changes data · Role: Admin · Not available through the MCP server

InputTypeDescription
email (body)string, requiredThe email address, a valid email address of up to 254 characters
name (body)string, requiredThe full name, up to 255 characters
role (body)one of admin, release_manager, approver, user, optionalThe built-in role. Defaults to user
password (body)string, requiredThe password. It must meet the password rule shown by account_password_policy

GET /api/auth/password-policy

Returns the minimum password length, whether upper and lower case letters, a digit and a symbol are required, and the rule as a sentence. No sign-in is needed.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

POST /api/auth/request-reset

Emails a password reset link, valid for 60 minutes, when the email belongs to an active user and email is set up. The answer is the same whether or not the account exists.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
email (body)string, requiredThe account email address

POST /api/auth/reset-password

Sets a new password using the token from a reset or invitation link, and ends the sessions the account already had. Refused when the token is invalid or expired or the password breaks the password rule.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
token (body)string, requiredThe token from the reset or setup link
newPassword (body)string, requiredThe new password. It must meet the password rule shown by account_password_policy

GET /api/auth/me

Returns the signed-in user with ID, email, name, role, sign-in provider, status and last sign-in, and when the session expires. Only a session token is accepted; personal API tokens are refused.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

GET /api/auth/session

Returns signedIn true with the user and when the session expires, or signedIn false, with the reason when the session was ended. A session cookie that no longer works is cleared. No sign-in is needed.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

POST /api/auth/logout

Ends the session sent with the request, the session cookie or a session token in the Authorization header, on every app container, and clears the cookie. Personal API tokens are revoked separately.

Changes data · Role: Any signed-in user · Not available through the MCP server

No inputs.

GET /api/auth/users

Lists every user, newest first, with role, sign-in provider, status and last sign-in. Only a session token is accepted; personal API tokens are refused.

Reads only · Role: Admin · Not available through the MCP server

No inputs.

PUT /api/auth/users/:id/role

Sets the built-in role of a user. The only active administrator cannot be given another role. Only a session token is accepted; personal API tokens are refused.

Changes data · Role: Admin · Not available through the MCP server

InputTypeDescription
id (path)string (uuid), requiredThe user ID
role (body)one of admin, release_manager, approver, user, requiredThe new built-in role

DELETE /api/auth/users/:id

Deactivates a user so they can no longer sign in; the account is kept. You cannot deactivate your own account or the only active administrator. Only a session token is accepted; personal API tokens are refused.

Changes data and can remove or overwrite it · Role: Admin · Not available through the MCP server

InputTypeDescription
id (path)string (uuid), requiredThe user ID

POST /api/auth/verify

Checks a session token and returns valid true with its user, or valid false when the token is invalid or expired, its user is missing or inactive, or the password changed after it was issued (401 SESSION_ENDED).

Reads only · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
token (body)string, requiredThe session token to check

POST /api/auth/mfa/verify

Exchanges the mfaToken from account_sign_in and a current authenticator or backup code for a session, answered like account_sign_in. Wrong codes count toward the account lockout, a locked account is refused with 423, and a used backup code cannot be used again.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
mfaToken (body)string, requiredThe mfaToken returned by account_sign_in, valid for 5 minutes
code (body)string, requiredA 6-digit authenticator code or a backup code. Spaces are ignored

POST /api/auth/mfa/setup

Creates a new authenticator secret for the signed-in user and returns it with an otpauth URL and a QR code image as a data URL; MFA is on only after account_mfa_enable. While MFA is on it is refused with 409 MFA_ALREADY_ENABLED; turn MFA off first. Only a session token is accepted; personal API tokens are refused.

Changes data · Role: Any signed-in user · Not available through the MCP server

No inputs.

POST /api/auth/mfa/enable

Turns on MFA after checking a code from the authenticator set up with account_mfa_setup, and returns 10 single-use backup codes that are shown only this once. Refused when MFA is already on or the code is wrong. Only a session token is accepted; personal API tokens are refused.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
code (body)string, requiredA 6-digit code from the authenticator

POST /api/auth/mfa/disable

Turns off MFA for the signed-in user and removes the authenticator secret and backup codes. It needs a current authenticator or backup code. Only a session token is accepted; personal API tokens are refused.

Changes data and can remove or overwrite it · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
code (body)string, requiredA current 6-digit authenticator code or a backup code. Spaces are ignored

GET /api/auth/mfa/status

Returns enabled true when the signed-in user has MFA turned on. Only a session token is accepted; personal API tokens are refused.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

GET /api/auth/tokens

Lists the personal API tokens of the caller, newest first, with name, prefix, access, last use, expiry and revocation time. The secret token is never returned.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

POST /api/auth/tokens

Creates a personal API token that acts as the caller, and returns the secret token once; it cannot be shown again. Send it as Authorization: Bearer or in the X-API-Key header. A read-only token is refused everything that would change something.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
name (body)string, requiredThe token name, up to 255 characters
access (body)one of full, read, optionalfull (the default) for everything the caller's role allows, or read for endpoints that read only
ideReadQueries (body)boolean, optionalWith access read, also run IDE queries in which every statement reads. Refused on a full-access token
expiresInDays (body)integer, 1 to 3650, optionalDays until the token expires, 1 to 3650. Leave it out for a token that does not expire

DELETE /api/auth/tokens/:id

Revokes one of the caller's own tokens at once. Refused with 404 when the token is not the caller's or is already revoked.

Changes data and can remove or overwrite it · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
id (path)string (uuid), requiredThe API token ID

POST /api/onboarding/provision-user

Creates a user and returns a setup link, valid for 48 hours, where they choose a password; the link is also emailed unless notify is false or the email service is not set up, and emailed says whether it was. Refused when the email is already used or no seat is free. An administrator session token or the provisioning key in the X-Provision-Key header is accepted; personal API tokens are refused.

Changes data · Role: Admin · Not available through the MCP server

InputTypeDescription
email (body)string, requiredThe email address of the new user, a valid email address of up to 254 characters
name (body)string, requiredThe full name, up to 255 characters
role (body)one of admin, release_manager, approver, user, optionalThe built-in role. Defaults to user
notify (body)boolean, optionalSend false to skip the welcome email

GET /api/onboarding/approve

Opens a signed approval link: creates the account named in the link, emails the person a setup link when the email service is set up, and returns an HTML page. A link without a valid role creates an administrator; an expired or altered link is refused.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
token (query)string, requiredThe signed approval token from the link

POST /api/onboarding/resend-invite

Issues a new 48-hour setup link for a user who has not signed in yet, reactivating the account if it was deactivated, and emails it when the email service is set up. Refused with 404 when there is no pending invitation for the email. An administrator session token or the provisioning key is accepted.

Changes data · Role: Admin · Not available through the MCP server

InputTypeDescription
email (body)string, requiredThe email address of the invited user, a valid email address of up to 254 characters

GET /api/auth/idp/saml/login

Redirects the browser to the SAML identity provider to sign in. Refused with 503 when SAML is not set up.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

POST /api/auth/idp/saml/callback

Receives the identity provider response, creates the user on first sign-in with the role mapped from their groups, and redirects to the app with a session token. Failures, including no free seat, redirect to the sign-in page with an error.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
SAMLResponse (body)string, optionalThe signed SAML response the identity provider posts

GET /api/auth/idp/oidc/login

Redirects the browser to the OpenID Connect provider and keeps the sign-in state for up to 10 minutes. Refused with 503 when OpenID Connect is not set up.

Changes data · Role: Any signed-in user · Not available through the MCP server

No inputs.

GET /api/auth/idp/oidc/callback

Exchanges the provider code for the user details, creates the user on first sign-in with the role mapped from their groups, and redirects to the app with a session token. An unknown or used state, or any failure, redirects to the sign-in page with an error.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
code (query)string, requiredThe authorization code from the provider
state (query)string, requiredThe state given when sign-in started

POST /api/auth/idp/ldap/login

Checks the username and password against the directory and returns the user and a session token, creating the user on first sign-in with the role mapped from their groups. Refused with 401 for wrong credentials or while LDAP is off, and 403 when the user has no seat.

Changes data · Role: Any signed-in user · Not available through the MCP server

InputTypeDescription
username (body)string, requiredThe directory username
password (body)string, requiredThe directory password

GET /api/auth/idp/status

Reports whether SAML, OpenID Connect and LDAP sign-in are on, the OpenID Connect provider name, and whether password sign-in is open to everyone or only administrators. No sign-in is needed.

Reads only · Role: Any signed-in user · Not available through the MCP server

No inputs.

GET /api/auth/idp/config

Returns the saved single sign-on settings, or null when none are saved, with the client secret and LDAP bind password blanked out.

Reads only · Role: Admin · Not available through the MCP server

No inputs.

PUT /api/auth/idp/config

Replaces the saved single sign-on settings with the ones sent and returns them with secrets blanked out; a blank or missing client secret or bind password keeps the stored one. Providers that are turned on take effect at once.

Changes data · Role: Admin · Not available through the MCP server

InputTypeDescription
config (body)object, optionalThe whole single sign-on configuration. It can also be sent as the request body itself
config.enableSSO (body)boolean, optionalTurns single sign-on on. While it is off, no provider is used
config.allowLocalAuth (body)boolean, optionalSend false so that only administrators sign in with a password while a provider is on
config.saml (body)object, optionalSAML settings
config.saml.enabled (body)boolean, optionalTurns SAML sign-in on
config.saml.entryPoint (body)string, optionalThe identity provider sign-in URL
config.saml.issuer (body)string, optionalThe issuer (entity ID) of this service
config.saml.cert (body)string, optionalThe identity provider signing certificate
config.saml.callbackUrl (body)string, optionalThe URL the identity provider posts the response to
config.saml.signatureAlgorithm (body)one of sha1, sha256, sha512, optionalThe signature algorithm
config.saml.identifierFormat (body)string, optionalThe name ID format
config.saml.wantAssertionsSigned (body)boolean, optionalRequire signed assertions
config.saml.attributeMapping (body)object, optionalWhich attributes of the identity provider hold the user details
config.saml.attributeMapping.email (body)string, optionalThe attribute that holds the email address
config.saml.attributeMapping.name (body)string, optionalThe attribute that holds the display name
config.oidc (body)object, optionalOpenID Connect settings
config.oidc.enabled (body)boolean, optionalTurns OpenID Connect sign-in on
config.oidc.provider (body)string, optionalThe provider name shown to users
config.oidc.issuer (body)string, optionalThe issuer URL; /authorize, /token and /userinfo are added to it
config.oidc.clientId (body)string, optionalThe client ID
config.oidc.clientSecret (body)string, optionalThe client secret. Leave it blank to keep the stored one
config.oidc.callbackUrl (body)string, optionalThe redirect URL registered with the provider
config.oidc.scope (body)list of string, optionalThe scopes to request
config.oidc.attributeMapping (body)object, optionalWhich attributes of the identity provider hold the user details
config.oidc.attributeMapping.email (body)string, optionalThe attribute that holds the email address
config.oidc.attributeMapping.name (body)string, optionalThe attribute that holds the display name
config.ldap (body)object, optionalLDAP settings
config.ldap.enabled (body)boolean, optionalTurns LDAP sign-in on
config.ldap.url (body)string, optionalThe directory URL, such as ldaps://host:636
config.ldap.bindDN (body)string, optionalThe DN of the account used to search the directory
config.ldap.bindCredentials (body)string, optionalThe password of that account. Leave it blank to keep the stored one
config.ldap.searchBase (body)string, optionalThe DN to search for users under
config.ldap.searchFilter (body)string, optionalThe search filter; {{username}} is replaced with the name the user enters
config.ldap.tlsOptions (body)object, optionalTLS options
config.ldap.tlsOptions.rejectUnauthorized (body)boolean, optionalRefuse directory certificates that are not trusted
config.ldap.attributeMapping (body)object, optionalWhich attributes of the identity provider hold the user details
config.ldap.attributeMapping.email (body)string, optionalThe attribute that holds the email address
config.ldap.attributeMapping.name (body)string, optionalThe attribute that holds the display name
config.roleMapping (body)object, optionalWhich identity provider groups give which role. Users in none of them get user
config.roleMapping.adminGroups (body)list of string, optionalGroups whose members are administrators
config.roleMapping.approverGroups (body)list of string, optionalGroups whose members are approvers
config.roleMapping.releaseManagerGroups (body)list of string, optionalGroups whose members are release managers