ObjectStackObjectStack

Auth Endpoints schema — API Protocol reference

Defines the canonical HTTP endpoints for the authentication service. Based on better-auth v1.4.18 endpoint conventions.

Authentication Endpoint Specification

Defines the canonical HTTP endpoints for the authentication service. Based on better-auth v1.4.18 endpoint conventions.

NOTE: ObjectStack's auth implementation uses better-auth library which has established endpoint conventions. This spec documents those conventions as the canonical API contract.

Source: packages/spec/src/api/auth-endpoints.zod.ts

TypeScript Usage

import { AuthEndpointSchema, AuthFeaturesConfigSchema, AuthProviderInfoSchema, DeviceRequestResponseSchema, DeviceTokenResponseSchema, EmailPasswordConfigPublicSchema, GetAuthConfigResponseSchema, OneTimeTokenHandoffQuerySchema, OneTimeTokenVerifyRequestSchema, OneTimeTokenVerifyResponseSchema, OrganizationEditionChoiceSchema } from '@objectstack/spec/api';
import type { AuthEndpoint, AuthFeaturesConfig, AuthProviderInfo, DeviceRequestResponse, DeviceTokenResponse, EmailPasswordConfigPublic, GetAuthConfigResponse, OneTimeTokenHandoffQuery, OneTimeTokenVerifyRequest, OneTimeTokenVerifyResponse, OrganizationEditionChoice } from '@objectstack/spec/api';

// Validate data
const result = AuthEndpointSchema.parse(data);

AuthEndpoint

Properties

PropertyTypeRequiredDescription
signInEmail{ method: 'POST'; path: '/sign-in/email'; description: 'Sign in with email and password' }✅
signUpEmail{ method: 'POST'; path: '/sign-up/email'; description: 'Register new user with email and password' }✅
signOut{ method: 'POST'; path: '/sign-out'; description: 'Sign out current user' }✅
getSession{ method: 'GET'; path: '/get-session'; description: 'Get current user session' }✅
forgetPassword{ method: 'POST'; path: '/forget-password'; description: 'Request password reset email' }✅
resetPassword{ method: 'POST'; path: '/reset-password'; description: 'Reset password with token' }✅
sendVerificationEmail{ method: 'POST'; path: '/send-verification-email'; description: 'Send email verification link' }✅
verifyEmail{ method: 'GET'; path: '/verify-email'; description: 'Verify email with token' }✅

AuthFeaturesConfig

Properties

PropertyTypeRequiredDescription
twoFactorbooleanoptional (default: false)Two-factor authentication enabled
passkeysneveroptional[REMOVED] features.passkeys was removed from GET /api/v1/auth/config in @objectstack/spec 17 (ADR-0049) — it was served from introduction and consumed by nothing: no login UI in any client reads it, and no better-auth passkey plugin is wired behind it, so a deployer who set plugins.passkeys: true flipped a switch that changed no behaviour anywhere. Delete the key. There is no replacement flag to read: passkey sign-in is not a capability this platform offers yet. It returns to this payload in the change that ships the login UI, classified in PUBLIC_AUTH_FEATURES again at that point — do not re-add it ahead of a consumer.
magicLinkneveroptional[REMOVED] features.magicLink was removed from GET /api/v1/auth/config in @objectstack/spec 17 (ADR-0049) — the ADVERTISEMENT was inert, not the capability: no client renders a magic-link sign-in affordance off this flag, so it only told a deployer that a UI existed when none did. Delete the key. The server side is unchanged and still yours to call: AuthPluginConfig.plugins.magicLink wires better-auth's magic-link plugin, and /api/v1/auth/magic-link/send + /magic-link/verify answer exactly as before — drive them from your own UI, or wait for the console release that restores this flag along with the login UI that reads it.
organizationbooleanoptional (default: false)Multi-tenant organization support enabled
ssobooleanoptionalEnterprise SSO sign-in usable: the domain-routed SSO plugin is wired AND at least one SSO provider is configured, so the login UI offers its "Sign in with SSO" entry; false when SSO is off, or on with no provider yet. The served value is that usable answer (isSsoUsable), not the coarse wired flag: GET /auth/config refines it before answering, and falls open to the wired flag when providers cannot be counted. Unlike ssoEnforced, which takes the password form away, this only says whether the SSO entry exists; absent means not usable
ssoEnforcedbooleanoptionalSSO-only login enforced: the UI hides the local password form + self-registration (a break-glass "use a password" link remains)
phoneNumberbooleanoptionalPhone-number sign-in enabled (phone + password, V1.5)
phoneNumberOtpbooleanoptionalPhone-number OTP sign-in and self-service password reset available — requires the phoneNumber plugin plus a deliverable SMS service
emailDeliverybooleanoptionalEmail leaves this deployment: the wired email service reports itself configured with a real transport, so password-reset, verification and invitation mail is delivered. False with no email service and with the stock log transport, which writes mail to the server console instead of sending it; the forgot-password page can then say a reset link cannot be emailed here and to ask an administrator. A statement about the deployment, never about an address: the password-reset request answers known and unknown addresses alike either way. Absent means not live
cloudManagedbooleanoptionalManaged (cloud-hosted, SSO-only) mode: people arrive through the identity provider, so the UI hides inviting, creating users and setting their passwords; absent means not managed
developerEditionCreatebooleanoptionalDeveloper Edition organizations can be created here: true exactly when organizationEditions holds a choice whose edition is developer, i.e. the host's organization-create door accepts ?edition=developer. The same fact as a boolean, so an action, param or field group can gate on it with requiresFeature; the choice's words and cap live in organizationEditions. An advertisement of the host's door, not a switch: it changes no server behaviour. Absent or false means no developer choice is offered
organizationEditions{ edition: string; label: string; hint: string; memberLimit?: integer }[]optionalEditions the host's organization-create door accepts besides its default, each with the edition query value, a label and a hint the host resolved in the request language, and its member cap when one applies. Each edition value appears once, so a picked choice names one door value. The create-organization form draws each as a choice that starts unchecked (the renderer's rule: no choice is ever picked for the user) and, when one is picked, sends its edition value to the create door. Served only when the host declares choices; absent means the door takes no edition and the form offers none
turnstileSiteKeystringoptionalPublic Cloudflare Turnstile site key, present only while the opt-in sign-up challenge is on: the sign-up form renders the widget and sends its token in the x-captcha-response header; absent means no challenge
multiOrgEnabledbooleanoptionalMulti-organization capability: true when the effective tenancy posture enforces an organization wall (group or isolated), the same answer the create-organization door gives; false on a single posture, and on a degraded deployment that asked for isolation but has none. The console offers creating, switching and leaving organizations only when it is on; the flag is default-on, so absent reads as on
tenancyPostureEnum<'single' | 'group' | 'isolated'>optionalWhich tenancy posture is in force (single, group or isolated): the effective posture, from the same derivation as multiOrgEnabled. A value, not a gate: multiOrgEnabled stays the capability flag, while this tells the console how to render organization context (under group the organization switcher picks the write target and reads span every organization the member belongs to)
audiencePostureEnum<'invite_only' | 'email_domain' | 'open'>optionalWho may self-register into this environment (invite_only, email_domain or open): the posture the sign-up path enforces, reported as invite_only when the configured value is off-vocabulary. A value, not a gate: emailPassword.disableSignUp stays the boolean that hides the sign-up form, while this lets the login page say that registration is by invitation instead of offering a form the server refuses
degradedTenancybooleanoptionalDegraded tenancy: true when multi-organization isolation was requested but is not active (the deployment booted only because OS_ALLOW_DEGRADED_TENANCY=1), so no engine enforces organization boundaries; the console can raise an operator warning off it. A status signal, not a capability gate; absent means not degraded
oidcProviderbooleanoptionalEmbedded OIDC authorization server wired, from the same decision that mounts it, so OAuth applications can be registered and managed; on by default alongside the MCP surface. It says nothing about sign-in providers, which socialProviders lists; the flag is default-on, so absent reads as on
deviceAuthorizationbooleanoptionalDevice authorization (browser-approved CLI login) wired, so the device-code endpoints answer; when false the console device-approval page says device authorization is not enabled instead of calling them. Absent means not wired
adminbooleanoptionalAdmin plugin wired (forced on whenever SCIM is enabled), so user administration (creating, banning, unlocking and impersonating users, setting their passwords) is available; the console shows those actions only when it is true. Absent means not wired
termsUrlstringoptionalTerms-of-service link shown beneath the login and register cards: the trimmed OS_TERMS_URL value when set, otherwise the public ObjectStack terms page; absent when the operator set OS_TERMS_URL to an empty or blank (whitespace-only) value to suppress the link
privacyUrlstringoptionalPrivacy-policy link shown beneath the login and register cards: the trimmed OS_PRIVACY_URL value when set, otherwise the public ObjectStack privacy page; absent when the operator set OS_PRIVACY_URL to an empty or blank (whitespace-only) value to suppress the link

Nested Shape: AuthFeaturesConfig.organizationEditions[number]

PropertyTypeRequiredDescription
editionstring✅The value the organization-create door takes in its edition query parameter for this choice (snake_case, e.g. developer); the client sends it back unchanged when the choice is picked
labelstring✅Display name of the choice, already resolved by the host in the language the request asked for; the form shows it as given
hintstring✅One line under the label saying what the choice means, already resolved by the host in the request language; the form shows it as given
memberLimitintegeroptionalMost members an organization of this edition may hold, when the edition caps them; the host's own figure, so a form that mentions the cap never spells a constant of its own. Absent means no cap is stated

AuthProviderInfo

Properties

PropertyTypeRequiredDescription
idstring✅Provider ID (e.g., google, github, microsoft, okta)
namestring✅Display name (e.g., Google, GitHub)
enabledboolean✅Whether this provider is enabled
typeEnum<'social' | 'oidc'>optional (default: "social")Provider type

DeviceRequestResponse

Properties

PropertyTypeRequiredDescription
codestring✅Short-lived device code used for polling
verificationUrlstring✅URL the user should open in a browser
expiresAtstring✅ISO timestamp when the code expires
intervalSecondsnumberoptional (default: 2)Recommended polling interval in seconds
intervalneveroptional[REMOVED] DeviceRequestResponse.interval was renamed to intervalSeconds in @objectstack/spec 17 — the polling cadence is a duration and its unit lived only in the describe prose. Rename the key to intervalSeconds; the value (seconds) is unchanged. This response is not an RFC 8628 device-authorization payload — it renames every RFC field it carries — so the standard does not fix the bare spelling here.

DeviceTokenResponse

Union Options

This schema accepts one of the following structures:

Option 1

Properties

PropertyTypeRequiredDescription
status'pending'✅

Option 2

Properties

PropertyTypeRequiredDescription
status'approved'✅
tokenstring✅Bearer token to store in credentials file
user{ id: string; email: string; name?: string }✅

Option 3

Properties

PropertyTypeRequiredDescription
status'expired'✅


EmailPasswordConfigPublic

Properties

PropertyTypeRequiredDescription
enabledboolean✅Whether email/password auth is enabled
disableSignUpbooleanoptionalWhether new user registration is disabled
requireEmailVerificationbooleanoptionalWhether email verification is required

GetAuthConfigResponse

Properties

PropertyTypeRequiredDescription
emailPassword{ enabled: boolean; disableSignUp?: boolean; requireEmailVerification?: boolean }✅Email/password authentication config
socialProviders{ id: string; name: string; enabled: boolean; type?: Enum<'social' | 'oidc'> }[]✅Available social/OAuth providers
features{ twoFactor?: boolean; organization?: boolean; sso?: boolean; ssoEnforced?: boolean; … }✅Enabled authentication features

Nested Shape: GetAuthConfigResponse.emailPassword

PropertyTypeRequiredDescription
enabledboolean✅Whether email/password auth is enabled
disableSignUpbooleanoptionalWhether new user registration is disabled
requireEmailVerificationbooleanoptionalWhether email verification is required

Nested Shape: GetAuthConfigResponse.socialProviders[number]

PropertyTypeRequiredDescription
idstring✅Provider ID (e.g., google, github, microsoft, okta)
namestring✅Display name (e.g., Google, GitHub)
enabledboolean✅Whether this provider is enabled
typeEnum<'social' | 'oidc'>optional (default: "social")Provider type

Nested Shape: GetAuthConfigResponse.features

PropertyTypeRequiredDescription
twoFactorbooleanoptional (default: false)Two-factor authentication enabled
passkeysneveroptional[REMOVED] features.passkeys was removed from GET /api/v1/auth/config in @objectstack/spec 17 (ADR-0049) — it was served from introduction and consumed by nothing: no login UI in any client reads it, and no better-auth passkey plugin is wired behind it, so a deployer who set plugins.passkeys: true flipped a switch that changed no behaviour anywhere. Delete the key. There is no replacement flag to read: passkey sign-in is not a capability this platform offers yet. It returns to this payload in the change that ships the login UI, classified in PUBLIC_AUTH_FEATURES again at that point — do not re-add it ahead of a consumer.
magicLinkneveroptional[REMOVED] features.magicLink was removed from GET /api/v1/auth/config in @objectstack/spec 17 (ADR-0049) — the ADVERTISEMENT was inert, not the capability: no client renders a magic-link sign-in affordance off this flag, so it only told a deployer that a UI existed when none did. Delete the key. The server side is unchanged and still yours to call: AuthPluginConfig.plugins.magicLink wires better-auth's magic-link plugin, and /api/v1/auth/magic-link/send + /magic-link/verify answer exactly as before — drive them from your own UI, or wait for the console release that restores this flag along with the login UI that reads it.
organizationbooleanoptional (default: false)Multi-tenant organization support enabled
ssobooleanoptionalEnterprise SSO sign-in usable: the domain-routed SSO plugin is wired AND at least one SSO provider is configured, so the login UI offers its "Sign in with SSO" entry; false when SSO is off, or on with no provider yet. The served value is that usable answer (isSsoUsable), not the coarse wired flag: GET /auth/config refines it before answering, and falls open to the wired flag when providers cannot be counted. Unlike ssoEnforced, which takes the password form away, this only says whether the SSO entry exists; absent means not usable
ssoEnforcedbooleanoptionalSSO-only login enforced: the UI hides the local password form + self-registration (a break-glass "use a password" link remains)
phoneNumberbooleanoptionalPhone-number sign-in enabled (phone + password, V1.5)
phoneNumberOtpbooleanoptionalPhone-number OTP sign-in and self-service password reset available — requires the phoneNumber plugin plus a deliverable SMS service
emailDeliverybooleanoptionalEmail leaves this deployment: the wired email service reports itself configured with a real transport, so password-reset, verification and invitation mail is delivered. False with no email service and with the stock log transport, which writes mail to the server console instead of sending it; the forgot-password page can then say a reset link cannot be emailed here and to ask an administrator. A statement about the deployment, never about an address: the password-reset request answers known and unknown addresses alike either way. Absent means not live
cloudManagedbooleanoptionalManaged (cloud-hosted, SSO-only) mode: people arrive through the identity provider, so the UI hides inviting, creating users and setting their passwords; absent means not managed
developerEditionCreatebooleanoptionalDeveloper Edition organizations can be created here: true exactly when organizationEditions holds a choice whose edition is developer, i.e. the host's organization-create door accepts ?edition=developer. The same fact as a boolean, so an action, param or field group can gate on it with requiresFeature; the choice's words and cap live in organizationEditions. An advertisement of the host's door, not a switch: it changes no server behaviour. Absent or false means no developer choice is offered
organizationEditions{ edition: string; label: string; hint: string; memberLimit?: integer }[]optionalEditions the host's organization-create door accepts besides its default, each with the edition query value, a label and a hint the host resolved in the request language, and its member cap when one applies. Each edition value appears once, so a picked choice names one door value. The create-organization form draws each as a choice that starts unchecked (the renderer's rule: no choice is ever picked for the user) and, when one is picked, sends its edition value to the create door. Served only when the host declares choices; absent means the door takes no edition and the form offers none
turnstileSiteKeystringoptionalPublic Cloudflare Turnstile site key, present only while the opt-in sign-up challenge is on: the sign-up form renders the widget and sends its token in the x-captcha-response header; absent means no challenge
multiOrgEnabledbooleanoptionalMulti-organization capability: true when the effective tenancy posture enforces an organization wall (group or isolated), the same answer the create-organization door gives; false on a single posture, and on a degraded deployment that asked for isolation but has none. The console offers creating, switching and leaving organizations only when it is on; the flag is default-on, so absent reads as on
tenancyPostureEnum<'single' | 'group' | 'isolated'>optionalWhich tenancy posture is in force (single, group or isolated): the effective posture, from the same derivation as multiOrgEnabled. A value, not a gate: multiOrgEnabled stays the capability flag, while this tells the console how to render organization context (under group the organization switcher picks the write target and reads span every organization the member belongs to)
audiencePostureEnum<'invite_only' | 'email_domain' | 'open'>optionalWho may self-register into this environment (invite_only, email_domain or open): the posture the sign-up path enforces, reported as invite_only when the configured value is off-vocabulary. A value, not a gate: emailPassword.disableSignUp stays the boolean that hides the sign-up form, while this lets the login page say that registration is by invitation instead of offering a form the server refuses
degradedTenancybooleanoptionalDegraded tenancy: true when multi-organization isolation was requested but is not active (the deployment booted only because OS_ALLOW_DEGRADED_TENANCY=1), so no engine enforces organization boundaries; the console can raise an operator warning off it. A status signal, not a capability gate; absent means not degraded
oidcProviderbooleanoptionalEmbedded OIDC authorization server wired, from the same decision that mounts it, so OAuth applications can be registered and managed; on by default alongside the MCP surface. It says nothing about sign-in providers, which socialProviders lists; the flag is default-on, so absent reads as on
deviceAuthorizationbooleanoptionalDevice authorization (browser-approved CLI login) wired, so the device-code endpoints answer; when false the console device-approval page says device authorization is not enabled instead of calling them. Absent means not wired
adminbooleanoptionalAdmin plugin wired (forced on whenever SCIM is enabled), so user administration (creating, banning, unlocking and impersonating users, setting their passwords) is available; the console shows those actions only when it is true. Absent means not wired
termsUrlstringoptionalTerms-of-service link shown beneath the login and register cards: the trimmed OS_TERMS_URL value when set, otherwise the public ObjectStack terms page; absent when the operator set OS_TERMS_URL to an empty or blank (whitespace-only) value to suppress the link
privacyUrlstringoptionalPrivacy-policy link shown beneath the login and register cards: the trimmed OS_PRIVACY_URL value when set, otherwise the public ObjectStack privacy page; absent when the operator set OS_PRIVACY_URL to an empty or blank (whitespace-only) value to suppress the link

OneTimeTokenHandoffQuery

Properties

PropertyTypeRequiredDescription
redirect_uristring✅Where to send the token: an absolute URI whose scheme is registered in AuthConfig.trustedAppSchemes (e.g. com.example.app://auth/callback); any other scheme is refused with 400 and no redirect
code_challengestring✅RFC 7636 S256 code challenge: the unpadded base64url SHA-256 of the verifier the app keeps (43 characters)
code_challenge_method'S256'optionalRFC 7636 challenge method; only S256 is accepted (plain is refused), and absent means S256

OneTimeTokenVerifyRequest

Properties

PropertyTypeRequiredDescription
tokenstring✅The hand-off token, a dot, then the RFC 7636 code verifier (43-128 characters) whose S256 challenge was sent to the hand-off

OneTimeTokenVerifyResponse

Properties

PropertyTypeRequiredDescription
session{ id: string; expiresAt: string; token?: string; ipAddress?: string; … }✅The session the token was minted from
user{ id: string; email: string; emailVerified?: boolean; name: string; … }✅The signed-in user

Nested Shape: OneTimeTokenVerifyResponse.user

PropertyTypeRequiredDescription
idstring✅User ID
emailstring✅Email address
emailVerifiedbooleanoptional (default: false)Is email verified?
namestring✅Display name
imagestring | nulloptionalAvatar URL
usernamestringoptionalUsername (optional)
rolesstring[]optional (default: [])Assigned role IDs
tenantIdstringoptionalCurrent tenant ID
languageneveroptional[REMOVED] SessionUser.language was removed in @objectstack/spec 17.4.0 (ADR-0049 enforce-or-remove) — it was declared with a permanent default of 'en' and never produced by any session endpoint nor read by any client, so a reader keying on it saw a constant, not the user's language. Delete the key. Read the signed-in user's language from GET /auth/me/localization (locale: the user's own sys_user.locale when set → the request's Accept-Language → the deployment default).
timezonestringoptionalPreferred timezone
createdAtstringoptional
updatedAtstringoptional

OrganizationEditionChoice

Properties

PropertyTypeRequiredDescription
editionstring✅The value the organization-create door takes in its edition query parameter for this choice (snake_case, e.g. developer); the client sends it back unchanged when the choice is picked
labelstring✅Display name of the choice, already resolved by the host in the language the request asked for; the form shows it as given
hintstring✅One line under the label saying what the choice means, already resolved by the host in the request language; the form shows it as given
memberLimitintegeroptionalMost members an organization of this edition may hold, when the edition caps them; the host's own figure, so a form that mentions the cap never spells a constant of its own. Absent means no cap is stated

On this page