Skip to Content
Documentation

API reference

Every endpoint of Ostiary's auth app under /api/auth, generated from its Better Auth configuration: what each one takes, returns and needs.

The pages in this section list the endpoints by feature. They come from the auth app's OpenAPI schema, apps/auth/openapi.json, which Better Auth's openAPI plugin generates from Ostiary's configuration. The repository's CI fails when that file no longer matches the code, so this reference follows the latest Ostiary release on main.

Base URL

Every path is relative to https://<your auth domain>/api/auth. The schema uses https://auth.example.com as a placeholder.

Authentication

  • Browser endpoints (sign-in, sessions, profile, two-factor, passkeys, organizations) use the session cookie that sign-in sets. Requests that change something must come from the auth app or a trusted origin.
  • Admin endpoints (/admin/*) need the session of a platform admin, who must have two-factor turned on unless REQUIRE_ADMIN_2FA is false.
  • OAuth endpoints (/oauth2/token, /oauth2/introspect, /oauth2/revoke) authenticate the client with HTTP Basic, client_secret_post or private_key_jwt. See Tokens and claims.
  • SCIM endpoints (/scim/v2/*) take an organization's SCIM token as a bearer token. See Provision users with SCIM.

What is left out

  • Endpoints Ostiary does not serve over HTTP: client management (the admin console registers apps), API key management (the dashboard and the admin console create keys) and Better Auth's session JWT (/token).
  • The discovery documents under /.well-known/, which Tokens and claims describes.

The schema is generated with every optional feature on. Features you leave off answer with an error: social providers you have not configured, Google One Tap, a captcha, or client self-registration.

Get the schema from your instance

The auth app serves its own schema at /api/auth/open-api/generate-schema in development. In production it is off unless you set OPENAPI_SCHEMA_ENABLED=true (Configuration). Better Auth's built-in reference page (/api/auth/reference) is always off: it loads a script from a CDN without a fixed version.

On this page