REST API reference

All /api/* endpoints require a Bearer access token (obtained through the OAuth flow), except the documented public first-run bootstrap operations and bootstrap status. Permissions are enforced per endpoint (see identity.md).

The console uses /realms/<realm>/api/* aliases of these endpoints, requiring the authenticated token's realm to match the URL. Unprefixed /api/* remains available and selects the realm from the token. See console.md. GET /api/meta is public only during main-realm bootstrap; afterwards it requires identity read access. It lists all realms only for main-realm super admins and otherwise lists only the caller's realm. Tenant tokens cannot inherit bootstrap access or select another realm with a targeting header.

Conventions:

  • Entities are plural nouns: principals, groups, roles, clients, providers, memberships.
  • GET /api/<entity> lists; GET /api/<entity>/<name> gets one; POST /api/<entity> creates/upserts (by name/client_id); PUT /api/<entity>/<name> updates; DELETE /api/<entity>/<name> deletes.
  • Single-name paths URL-encode the name.
  • Secret fields are redacted in responses (password, mfa_secret, client_secret) except on create (auto-generated client secrets are shown once) and on rotate-secret.

Entity endpoints

Endpoint HTTP Required permission Notes
/api/principals GET/POST principals.read/write Create/upsert principal. New principals get login by default; it is never re-added on update.
/api/principals/<name> GET/PUT/DELETE principals.read/write/delete Update/delete one principal.
/api/groups GET/POST groups.read/write
/api/groups/<name> GET/PUT/DELETE groups.read/write/delete
/api/roles GET/POST roles.read/write
/api/roles/<name> GET/PUT/DELETE roles.read/write/delete
/api/clients GET/POST clients.read/write Create client; server may auto-generate client_secret (returned once). Internal UI client is server-managed (403).
/api/clients/<name> GET/PUT/DELETE clients.read/write/delete
/api/clients/<name>/rotate-secret POST clients.write Atomically rotate client secret; new value returned exactly once.
/api/providers GET/POST providers.read/write
/api/providers/<name> GET/PUT/DELETE providers.read/write/delete
/api/memberships GET/POST memberships.read/write Tenant-local home-identity grants; see memberships.md.
/api/memberships/<name> GET/PUT/POST/DELETE memberships.read/write/delete Update/delete one grant.

Realms (super)

Membership schema, GitOps examples, login identifiers and lifecycle rules are documented in Cross-realm memberships. API writes and runtime use both validate these objects. Credential self-service on a membership session is rejected; manage passwords/MFA/providers/email verification in the home realm.

Endpoint HTTP Required Notes
/api/realms GET ipseity.super List realms with counts + signing summary.
/api/realms/<realm> GET ipseity.super Detail for one realm.
/api/realms POST ipseity.super Create a realm: {"name": "…"}. Tolerates an existing namespace (adopts it, preserving its objects).
/api/realms/<realm> DELETE ipseity.super Release (default): remove Ipseity-managed objects and the realm label, keeping the namespace.
/api/realms/<realm>?purge=true DELETE ipseity.super Purge: delete the namespace and everything inside it.
/api/realms/<realm>/rotate-signing-key POST ipseity.super Rotate the realm's signing key.

Account self-service (any authenticated principal)

Endpoint HTTP Purpose
/api/account GET Your profile (email, MFA state, linked providers).
/api/account/password POST Change password (current + new ≥8 chars); revokes other sessions.
/api/account/mfa/enroll POST Start TOTP enrollment (requires current password); returns secret + otpauth URI.
/api/account/mfa/confirm POST Confirm enrollment with a 6-digit code; enables MFA.
/api/account/mfa/reset POST Disable MFA (current password + current TOTP code).
/api/account/sessions GET Your active sessions (refresh tokens).
/api/account/sessions/revoke POST Revoke a session by session_id, or {all: true}.
/api/account/providers/unlink POST Unlink a linked external provider.

Email verification

Endpoint HTTP Purpose
/api/email/verify/send POST Send a verification link for your email (or another principal with principals.write). Body {"name": …}.

Session / metadata / bootstrap / audit

Endpoint HTTP Auth Purpose
/api/session GET Bearer Current principal + realm + effective RBAC.
/api/meta GET Any identity read; public during main bootstrap Entities, scopes, permissions, own realm (full directory for main super admins), super flag, issuer and endpoint lists.
/api/bootstrap/status GET public Reports bootstrap open/closed + counts.
/api/bootstrap/admin POST public (bootstrap-only) Create the initial administrator while bootstrap is open.
/api/audit GET admin.audit.read Recent per-realm audit events from the serving process ({"items": […]}); durable history is in the collected AUDIT logs.

Payload shapes (create/update)

Principal

{
  "name": "alice",
  "type": "user",
  "password": "s3cret!pw",
  "groups": ["platform-admins"],
  "roles": [],
  "permissions": [],
  "mfa_enabled": false,
  "mfa_secret": "",
  "disabled": false,
  "email": "alice@example.com",
  "display_name": "Alice",
  "given_name": "Alice",
  "family_name": "Example"
}

display_name is the canonical displayable full name; given_name/family_name are optional structured name parts (also captured from external providers and emitted as OIDC profile claims). When display_name is omitted but given_name/family_name are supplied, the display name is synthesized from them.

When updating an existing principal, an omitted, empty or whitespace-only password preserves the stored password hash. A non-blank plaintext password replaces it; pre-hashed passwords remain rejected. These rules apply to POST /api/principals when the name already exists (the console's save route), POST /api/principals/<name> and PUT /api/principals/<name>, including their realm-prefixed aliases. Blank password input cannot remove an existing password.

When mfa_enabled is true, an omitted or blank mfa_secret likewise preserves the existing secret. Creating a new MFA-enabled principal still requires a secret. The console sends empty secret fields for values it did not change; passwords and MFA secrets stay redacted in API responses.

Group

{ "name": "platform-admins", "description": "…", "roles": ["viewer"], "permissions": [] }

Role

{ "name": "viewer", "permissions": ["identity.read"] }

Client

{
  "name": "web-console",
  "client_id": "web-console",
  "public_client": true,
  "client_secret": "",
  "redirect_uris": ["https://app.example.com/callback"],
  "allowed_scopes": ["openid", "profile", "groups", "roles"],
  "allowed_origins": ["https://app.example.com"],
  "require_consent": false,
  "frontchannel_logout_uri": "https://app.example.com/logout/frame",
  "backchannel_logout_uri": "https://app.example.com/logout/token"
}

Provider

See providers.md for the full provider schema (OAuth2 vs OIDC, public/private, discovery URL or explicit endpoints, email claim, auto-provision, default groups/roles).

Errors

Errors return JSON with an error field and an appropriate HTTP status:

Status Meaning
400 Invalid request / unsupported scope / invalid redirect.
401 Missing/invalid token or credentials.
403 Missing permission, disabled entity, or policy rejection.
404 Entity not found.
409 Conflict (e.g. duplicate create, unlink last provider).
422 Validation (StoreError/ValueError).
429 Rate limit exceeded or principal locked.