# Console session API

## POST /api/v1/admin/login

`POST /api/v1/admin/login` · operation `adminLogin`

Exchange a bootstrap or named console user token for an HttpOnly SameSite session cookie and CSRF token. Viewer sessions can read global console data but cannot mutate control-plane resources. Named users require console_users and PostgreSQL; disabling one invalidates its sessions. Requires same-origin browser request. With admin.token_login false the shared admin and viewer tokens are refused with the same 401 as an unknown token, and the cookies they opened earlier stop working; with admin.token_bearer true, automation can send the shared token as Authorization Bearer to the admin operations instead (see the adminSession scheme). A shared-token cookie is bound to the hash of the token that opened it, so rotating the token ends its cookies. After admin.login_lockout.max_failures wrong tokens from one client address within its window, that address gets 429 until the lockout ends.

**Authentication:** None.

**Request body** (required)

- `application/json`: object
  - `token` (string, required, min length 16, write-only)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Authenticated console session | `application/json`: [AdminSession](/docs/api/schemas/a/#adminsession) |
| `202` | Native console MFA (T086.002): the first factor succeeded but this identity has a confirmed factor, a reset latch or a policy requirement. No session cookie, role or permission is issued; an HttpOnly pending cookie is set. Continue with the /mfa routes and the X-MFA-Challenge header. | `application/json`: [NativeMFAPending](/docs/api/schemas/n/#nativemfapending) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | native_mfa_unavailable: this identity requires console MFA but local_mfa or every usable method is off. It never falls back to one factor. | — |
| `429` | admin.login_lockout (T137): this client address sent too many wrong tokens within the window and is locked out of token sign-in, the right token included, until the lockout ends (code login_locked_out). Single sign-on is not affected. | `application/json`: [Error](/docs/api/schemas/e/#error) |


## GET /api/v1/admin/auth/providers

`GET /api/v1/admin/auth/providers` · operation `consoleLoginProviders`

Public same-origin login metadata. Returns only configured provider labels and canonical start links, never issuer/client/subject mappings or secrets. Empty providers means token login only. token_login is admin.token_login (whether the shared admin and viewer tokens may open a console session) and personal_tokens is console_users (whether named users sign in with their own token); older gateways omit both.

**Authentication:** None.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Available federated login methods; no-store | `application/json`: object |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |

Response `200` fields:

- `application/json`: object
  - `token_login` (boolean) — admin.token_login: false refuses the shared admin and viewer tokens at console login.
  - `personal_tokens` (boolean) — console_users: named users sign in with their personal token.
  - `providers` (array of object, required, max items 10)
    - `id` (string, required, pattern `^[a-z][a-z0-9_-]{0,63}$`) — Legacy oidc/saml or safe boot-admitted named ID.
    - `label` (string, required, min length 1, max length 80)
    - `login_url` (string, required, pattern `^/api/v1/admin/(auth/oidc/([a-z][a-z0-9_-]{0,63}/)?start|saml/start)$`) — Exact ID-matching same-origin start path; never an arbitrary URL.


## GET /api/v1/admin/saml/start

`GET /api/v1/admin/saml/start` · operation `startSAMLLogin`

Begin the explicitly configured SP-initiated SAML2 Redirect/POST login. Sets a Secure HttpOnly SameSite=None `__Host-` cookie that seals the request binding (AES-GCM, expires with request_ttl); nothing is persisted until a signed response verifies. Requires saml_login, a valid configured policy and PostgreSQL. No user provisioning or role grants.

**Authentication:** None.

**Responses**

| Status | Description | Body |
|---|---|---|
| `302` | Redirect to the configured HTTPS IdP SSO endpoint with an AuthnRequest. | — |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | SAML policy or control state unavailable; no login established. | — |


## GET /api/v1/admin/saml/metadata

`GET /api/v1/admin/saml/metadata` · operation `samlServiceProviderMetadata`

Read public SP metadata for the supported SAML2 profile. Redirect AuthnRequests are unsigned; the IdP must sign both its Response and Assertion. With saml_encrypted_assertions (T168) every SP certificate of admin.saml_service_provider (current and previous) is listed as a KeyDescriptor use="encryption" with the accepted algorithms; with saml_single_logout and both logout URLs set, the current certificate is listed as use="signing" and slo_url as SingleLogoutService for the Redirect and POST bindings. No private key, subject mapping or session data is exposed.

**Authentication:** None.

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | SP entity ID, canonical HTTPS ACS and supported binding; no-store. | `application/samlmetadata+xml`: string |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | SAML policy or durable state unavailable. | — |


## POST /api/v1/admin/saml/callback

`POST /api/v1/admin/saml/callback` · operation `finishSAMLLogin`

Browser-only SAML2 HTTP-POST ACS. Requires the sealed browser flow cookie from this browser's start and its exact RelayState. Verifies both trusted XML signatures, qualified identity, issuer, audience, destination, recipient, InResponseTo and bounded times/shape before atomically consuming request/response/assertion IDs across replicas. Only an explicitly mapped active local user gets the normal local console session; claims never grant roles or teams. Unsolicited IdP-initiated responses are rejected. An EncryptedAssertion is accepted only with saml_encrypted_assertions (T168). The Response signature over the ciphertext is verified first, the content must be AES-128/256-GCM or AES-128/256-CBC with RSA-OAEP key transport (RSA 1.5 and anything else refused), it is decrypted with the current then the previous SP key, and the decrypted Assertion must itself be signed by a pinned certificate and pass every assertion check; require_encrypted_assertions refuses plain assertions. Failures return a generic problem without assertion data.

**Authentication:** None.

**Request body** (required)

- `application/x-www-form-urlencoded`: object
  - `SAMLResponse` (string, required, min length 1) — Base64 signed response within the configured decoded-byte/XML limits.
  - `RelayState` (string, required, min length 1, max length 512) — Exact opaque relay value issued by this browser's start flow.

**Responses**

| Status | Description | Body |
|---|---|---|
| `303` | Local console session issued; redirects to /ui. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Valid signed identity not bound to an active local user (saml_login_failed), or, with federated_jit, a first login whose new account waits for approval (jit_pending); no session issued. | — |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | Callback capacity, replay state or local identity storage unavailable; no session issued. | — |


## GET /api/v1/admin/saml/slo

`GET /api/v1/admin/saml/slo` · operation `finishSAMLLogoutRedirect`

T168, flag saml_single_logout: the IdP's LogoutResponse on the HTTP-Redirect binding, answering the signed LogoutRequest that console sign-out sent after clearing the local session. Requires the sealed Secure HttpOnly SameSite=None `__Host-aigw_saml_logout` cookie of this browser and its exact RelayState; verifies the RSA-SHA256 query signature over the exact received octets with a pinned IdP certificate, Version, Issuer, Destination (slo_url), InResponseTo and the issue time, then spends the request and response IDs once across replicas. Success and IdP failure statuses both redirect to /ui; the console session was already gone. An IdP-initiated LogoutRequest is refused (not adopted).

**Authentication:** None.

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `SAMLResponse` | query | string, required, min length 1 | Deflated base64 LogoutResponse. |
| `RelayState` | query | string, required, min length 1, max length 512 |  |
| `SigAlg` | query | `"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"`, required |  |
| `Signature` | query | string, required, min length 1 |  |

**Responses**

| Status | Description | Body |
|---|---|---|
| `303` | Logout response accepted; redirects to /ui. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | Callback capacity or replay state unavailable. | — |


## POST /api/v1/admin/saml/slo

`POST /api/v1/admin/saml/slo` · operation `finishSAMLLogoutPost`

T168, flag saml_single_logout: the same LogoutResponse on the HTTP-POST binding, with an enveloped RSA-SHA256 signature by a pinned IdP certificate (exclusive canonicalization, as for login). Same flow cookie, checks and outcome as the Redirect binding.

**Authentication:** None.

**Request body** (required)

- `application/x-www-form-urlencoded`: object
  - `SAMLResponse` (string, required, min length 1) — Base64 signed LogoutResponse within max_response_bytes.
  - `RelayState` (string, required, min length 1, max length 512)

**Responses**

| Status | Description | Body |
|---|---|---|
| `303` | Logout response accepted; redirects to /ui. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | Callback capacity or replay state unavailable. | — |


## GET /api/v1/admin/saml/settings

`GET /api/v1/admin/saml/settings` · operation `samlLoginSettings`

Read the effective typed SAML policy, safe public certificate material, explicit local subject bindings, source, defaults and global version. Requires saml_management and global users:manage; usable while saml_login is disabled or unconfigured. No SP private key is used by this profile.

**Authentication:** `adminSession`

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Current policy and provenance; no-store. | `application/json`: [SAMLLoginSettings](/docs/api/schemas/s/#samlloginsettings) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | Managed storage unavailable. | — |


## PUT /api/v1/admin/saml/settings

`PUT /api/v1/admin/saml/settings` · operation `setSAMLLoginSettings`

Publish a complete validated SAML override with global users:manage, CSRF and current-version CAS. The control transaction records audit/correlation and advances the durable SAML authentication generation. New flows use the new policy; old SAML flows/sessions cannot be revived. Tokens/bootstrap/OIDC are unchanged. Certificate material is public; no disable-signature or implicit role mapping field is accepted.

**Authentication:** `adminSession`

**Request body** (required)

- `application/json`: object
  - `version` (integer, required, min 0)
  - `saml` ([SAMLLoginPolicy](/docs/api/schemas/s/#samlloginpolicy), required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Complete policy and authentication generation committed atomically. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `409` | Stale control version; no mutation. | — |
| `503` | Storage unavailable; no trust publication. | — |


## DELETE /api/v1/admin/saml/settings

`DELETE /api/v1/admin/saml/settings` · operation `revertSAMLLoginSettings`

Remove the managed policy and restore the YAML baseline (or unconfigured default). Requires the same management/CSRF/CAS authority as PUT and advances the authentication generation. Does not delete local users or change their roles.

**Authentication:** `adminSession`

**Request body** (required)

- `application/json`: object
  - `version` (integer, required, min 0)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Override removed and baseline restored atomically. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `409` | Stale control version; no mutation. | — |
| `503` | Storage unavailable; no trust publication. | — |


## GET /api/v1/admin/auth/oidc/start

`GET /api/v1/admin/auth/oidc/start` · operation `startOIDCLogin`

Begin authorization-code login with PKCE, state and nonce. Sets an encrypted HttpOnly flow cookie and redirects the browser to the explicitly trusted identity provider. Requires oidc_login and boot configuration; does not create users or grant roles from claims.

**Authentication:** None.

**Responses**

| Status | Description | Body |
|---|---|---|
| `302` | Redirect to trusted identity provider | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | Identity provider unavailable or untrusted discovery | — |


## GET /api/v1/admin/auth/oidc/callback

`GET /api/v1/admin/auth/oidc/callback` · operation `finishOIDCLogin`

Browser callback only. Requires the flow cookie, matching state and single-use authorization code. Validates token signature, issuer, audience, expiry, nonce and immutable subject mapping to an active existing PostgreSQL user. Tokens are never returned to JavaScript. Roles/memberships remain database-owned. Optional boot oidc_group_policy requires a verified bounded top-level group claim and local subject binding; claims do not grant roles. Policy/flag participate in flow/session trust fingerprints; group changes at IdP are evaluated on next login or explicit revocation. With federated_jit, an unlinked allowlisted identity gets a pending local user (user role, no teams); its sign-in answers 303 to /ui/#login=pending for a browser, or 403 jit_pending otherwise, until an administrator approves it.

**Authentication:** None.

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `code` | query | string, required |  |
| `state` | query | string, required |  |

**Responses**

| Status | Description | Body |
|---|---|---|
| `303` | Session established; redirect to /ui. With federated_jit, a pending account redirects to /ui/#login=pending instead | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | jit_pending: the account a first login created waits for administrator approval (non-browser clients) | — |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | Identity provider or local identity database unavailable | — |


## GET /api/v1/admin/session

`GET /api/v1/admin/session` · operation `adminSession`

Current session. While this browser holds a live native MFA pending flow, answers 202 with that flow (a reload resumes it) even if an earlier session cookie exists; mfa_method names the native factor that completed the session.

**Authentication:** `adminSession`

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Current session and CSRF token | `application/json`: [AdminSession](/docs/api/schemas/a/#adminsession) |
| `202` | Native console MFA (T086.002): the first factor succeeded but this identity has a confirmed factor, a reset latch or a policy requirement. No session cookie, role or permission is issued; an HttpOnly pending cookie is set. Continue with the /mfa routes and the X-MFA-Challenge header. | `application/json`: [NativeMFAPending](/docs/api/schemas/n/#nativemfapending) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | authentication_state_unavailable: native MFA state could not be read; the session is not admitted | — |


## POST /api/v1/admin/logout

`POST /api/v1/admin/logout` · operation `adminLogout`

Clears the console session cookie. With oidc_rp_logout and a federated session whose provider publishes a trusted end_session_endpoint, also returns the provider URL (client_id and the configured post_logout_redirect_uri) for the browser to visit.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-CSRF-Token` | header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Session cookie cleared; the browser should continue to the identity provider to end that session too | `application/json`: object |
| `204` | Session cookie cleared | — |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |

Response `200` fields:

- `application/json`: object
  - `end_session_url` (string (uri), required)


## GET /api/v1/admin/config

`GET /api/v1/admin/config` · operation `adminConfig`

Sanitized configuration; never returns key hashes, bearer tokens, provider credentials or environment values. Team viewers receive only role, active membership IDs and feature availability; provider/model/control metadata is omitted.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `parameter_catalog_version` | query | integer, one of `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, default `1` | Optional exact metadata catalog version1 through26; omitted defaults to1. Each selector is opt-in; the current console makes one V26 fetch. No applied values or private references are added by selection. |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Active configuration snapshot and control version | `application/json`: [AdminConfig](/docs/api/schemas/a/#adminconfig) |
| `400` | Invalid parameter catalog version selector | — |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |


## Inspect custom role definitions, bindings, sources and finite capabilities

`GET /api/v1/admin/custom-roles` · operation `customRoleCatalog`

Builtin global administrators only. Flags do not grant authority. Assigned custom users never fall back to builtin privileges when their role is unavailable; these operations require canonical version/base assertions.

**Authentication:** `adminSession`

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Private no-store role catalog; no credential material. | `application/json`: [CustomRoleCatalog](/docs/api/schemas/c/#customrolecatalog) |
| `400` | Malformed or noncanonical input | — |
| `401` | Console session required | — |
| `403` | Builtin global administrator and current license required | — |
| `404` | Named user, role, override or management feature unavailable | — |
| `409` | Stale version, referenced role or changed YAML base; review before retry | — |
| `422` | Role or assignment incompatible with the live catalog or builtin user role | — |
| `503` | Storage unavailable or committed configuration synchronization pending | — |


## Create or replace one restrictive role definition

`PUT /api/v1/admin/custom-roles/{id}` · operation `putCustomRole`

Builtin global administrators only. Flags do not grant authority. Assigned custom users never fall back to builtin privileges when their role is unavailable; these operations require canonical version/base assertions.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | [CustomRoleID](/docs/api/schemas/c/#customroleid), required |  |

**Request body** (required)

- `application/json`: [CustomRoleWrite](/docs/api/schemas/c/#customrolewrite)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Committed. Reload catalog and user versions before another mutation. | — |
| `400` | Malformed or noncanonical input | — |
| `401` | Console session required | — |
| `403` | Builtin global administrator and current license required | — |
| `404` | Named user, role, override or management feature unavailable | — |
| `409` | Stale version, referenced role or changed YAML base; review before retry | — |
| `413` | Writer exceeds16KiB | — |
| `422` | Role or assignment incompatible with the live catalog or builtin user role | — |
| `503` | Storage unavailable or committed configuration synchronization pending | — |


## Remove a console role override or restore its YAML base

`DELETE /api/v1/admin/custom-roles/{id}` · operation `revertCustomRole`

Builtin global administrators only. Flags do not grant authority. Assigned custom users never fall back to builtin privileges when their role is unavailable; these operations require canonical version/base assertions.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | [CustomRoleID](/docs/api/schemas/c/#customroleid), required |  |

**Request body** (required)

- `application/json`: [CustomRoleVersionWrite](/docs/api/schemas/c/#customroleversionwrite)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Committed. Reload catalog and user versions before another mutation. | — |
| `400` | Malformed or noncanonical input | — |
| `401` | Console session required | — |
| `403` | Builtin global administrator and current license required | — |
| `404` | Named user, role, override or management feature unavailable | — |
| `409` | Stale version, referenced role or changed YAML base; review before retry | — |
| `413` | Writer exceeds16KiB | — |
| `422` | Role or assignment incompatible with the live catalog or builtin user role | — |
| `503` | Storage unavailable or committed configuration synchronization pending | — |


## Assign a restrictive ceiling or explicitly clear it with null

`PUT /api/v1/admin/users/{id}/custom-role` · operation `setUserCustomRole`

Builtin global administrators only. Flags do not grant authority. Assigned custom users never fall back to builtin privileges when their role is unavailable; these operations require canonical version/base assertions.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required, min length 36, max length 36, pattern `^usr_[a-f0-9]{32}(?![\s\S])` |  |

**Request body** (required)

- `application/json`: [CustomRoleBindingWrite](/docs/api/schemas/c/#customrolebindingwrite)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Committed. Reload catalog and user versions before another mutation. | — |
| `400` | Malformed or noncanonical input | — |
| `401` | Console session required | — |
| `403` | Builtin global administrator and current license required | — |
| `404` | Named user, role, override or management feature unavailable | — |
| `409` | Stale version, referenced role or changed YAML base; review before retry | — |
| `413` | Writer exceeds16KiB | — |
| `422` | Role or assignment incompatible with the live catalog or builtin user role | — |
| `503` | Storage unavailable or committed configuration synchronization pending | — |


## Restore the declared YAML binding with explicit user and global versions

`DELETE /api/v1/admin/users/{id}/custom-role` · operation `revertUserCustomRole`

Builtin global administrators only. Flags do not grant authority. Assigned custom users never fall back to builtin privileges when their role is unavailable; these operations require canonical version/base assertions.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required, min length 36, max length 36, pattern `^usr_[a-f0-9]{32}(?![\s\S])` |  |

**Request body** (required)

- `application/json`: [CustomRoleBindingRevert](/docs/api/schemas/c/#customrolebindingrevert)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Committed. Reload catalog and user versions before another mutation. | — |
| `400` | Malformed or noncanonical input | — |
| `401` | Console session required | — |
| `403` | Builtin global administrator and current license required | — |
| `404` | Named user, role, override or management feature unavailable | — |
| `409` | Stale version, referenced role or changed YAML base; review before retry | — |
| `413` | Writer exceeds16KiB | — |
| `422` | Role or assignment incompatible with the live catalog or builtin user role | — |
| `503` | Storage unavailable or committed configuration synchronization pending | — |


## Adopt the reviewed declared YAML role base

`POST /api/v1/admin/custom-roles/adopt-base` · operation `adoptCustomRoleBase`

Builtin global administrators only. Flags do not grant authority. Assigned custom users never fall back to builtin privileges when their role is unavailable; these operations require canonical version/base assertions.

**Authentication:** `adminSession`

**Request body** (required)

- `application/json`: [CustomRoleVersionWrite](/docs/api/schemas/c/#customroleversionwrite)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Committed. Reload catalog and user versions before another mutation. | — |
| `400` | Malformed or noncanonical input | — |
| `401` | Console session required | — |
| `403` | Builtin global administrator and current license required | — |
| `404` | Named user, role, override or management feature unavailable | — |
| `409` | Stale version, referenced role or changed YAML base; review before retry | — |
| `413` | Writer exceeds16KiB | — |
| `422` | Role or assignment incompatible with the live catalog or builtin user role | — |
| `503` | Storage unavailable or committed configuration synchronization pending | — |


## PUT /api/v1/admin/features/{id}

`PUT /api/v1/admin/features/{id}` · operation `setFeatureOverride`

Versioned PostgreSQL override of a runtime-mutable feature. Validates all feature dependencies. UI and OTLP exporter flags require YAML rollout.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required | Registered runtime-mutable feature ID |
| `X-CSRF-Token` | header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |

**Request body** (required)

- `application/json`: object
  - `version` (integer (int64), required)
  - `enabled` (boolean, required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Override applied and active version returned | — |
| `400` | Invalid payload | — |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `409` | Control version conflict | — |
| `422` | Startup-only feature or invalid dependency combination | — |


## DELETE /api/v1/admin/features/{id}

`DELETE /api/v1/admin/features/{id}` · operation `revertFeatureOverride`

Remove the console override and restore the YAML value.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required | Registered runtime-mutable feature ID |
| `X-CSRF-Token` | header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |

**Request body** (required)

- `application/json`: object
  - `version` (integer (int64), required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | YAML value restored and active version returned | — |
| `404` | No override exists | — |
| `409` | Control version conflict | — |
| `422` | Startup-only feature or invalid dependency combination | — |


## POST /api/v1/admin/auth/oidc/backchannel-logout

`POST /api/v1/admin/auth/oidc/backchannel-logout` · operation `oidcBackchannelLogout`

Requires boot oidc_backchannel_logout and nonempty OIDC session_epoch. IdP-to-gateway signed logout_token authenticates the request: no console cookie, Origin or CSRF required. Profile validates issuer/audience/signature, events, iat/exp &lt;=5min, jti, sub or sid and absence of nonce. Shared replay/tombstones prevent callback resurrection. Revokes only matching federated sessions; local/bootstrap sessions remain. Invalid/replayed assertion returns400; temporary storage/trust/capacity failure503 is an operational profile extension. Not universal IdP certification.

**Authentication:** None.

**Request body** (required)

- `application/x-www-form-urlencoded`: object
  - `logout_token` (string, required, max length 16384)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Valid logout accepted, including unknown subject/session; no session inventory disclosed | — |
| `400` | Invalid assertion or replay | — |
| `404` | Feature disabled | — |
| `413` | Assertion exceeds bound | — |
| `415` | Form content type required | — |
| `503` | Storage, IdP trust or capacity temporarily unavailable; assertion not acknowledged | — |


## GET /api/v1/admin/auth/oidc/{id}/start

`GET /api/v1/admin/auth/oidc/{id}/start` · operation `startNamedOIDCLogin`

Begin one provider-specific browser-bound PKCE/state/nonce flow. Unknown or disabled ID is refused before network access. Official named Google/Microsoft profiles also require their effective vendor admission switch (google_oidc_login or microsoft_oidc_login; default true, parent runtime default false).

**Authentication:** None.

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | [NamedOIDCProviderID](/docs/api/schemas/n/#namedoidcproviderid), required |  |

**Responses**

| Status | Description | Body |
|---|---|---|
| `302` | Redirect the same browser; tokens never returned to JavaScript. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `409` | Stale version/base or configuration drift; reload and review, no mutation. | — |
| `422` | Invalid policy, duplicate active issuer/client, invalid local user or cross-field dependency. | — |
| `503` | Current configuration, storage, or bounded admission unavailable; no authority issued. | — |


## GET /api/v1/admin/auth/oidc/{id}/callback

`GET /api/v1/admin/auth/oidc/{id}/callback` · operation `finishNamedOIDCLogin`

Verify exact selected issuer/client, sole audience, optional azp, signed nonce and current generation; exact explicit subject mapping only. No JIT/SCIM externalId/email fallback. A present authorization-response iss must match exactly before code exchange. Enforce missing iss only when trusted discovery advertises support. Late disabled/changed flows cannot issue sessions. Official named Google accepts its documented bare ID-token issuer alias only after cryptographic verification; Microsoft requires signed tid matching the exact organizational tenant-GUID public-v2 issuer. Vendor admission switches deny flows and sessions without changing legacy singleton OIDC.

**Authentication:** None.

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | [NamedOIDCProviderID](/docs/api/schemas/n/#namedoidcproviderid), required |  |
| `code` | query | string, required |  |
| `state` | query | string, required |  |
| `iss` | query | string |  |

**Responses**

| Status | Description | Body |
|---|---|---|
| `303` | Redirect the same browser; tokens never returned to JavaScript. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `409` | Stale version/base or configuration drift; reload and review, no mutation. | — |
| `422` | Invalid policy, duplicate active issuer/client, invalid local user or cross-field dependency. | — |
| `503` | Current configuration, storage, or bounded admission unavailable; no authority issued. | — |


## POST /api/v1/admin/auth/oidc/{id}/backchannel-logout

`POST /api/v1/admin/auth/oidc/{id}/backchannel-logout` · operation `logoutNamedOIDCBackchannel`

IdP-signed logout token, not console credentials/CSRF. Requires oidc_backchannel_logout plus active named runtime. Issuer/client/profile and current durable generation isolate logout. Token iat must satisfy the DB generation-change +30s accepted-skew ceiling; up to31s after security changes is conservatively rejected. Label edits preserve the fence. No provider retry guarantee. Local and RP logout remain available.

**Authentication:** None.

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | [NamedOIDCProviderID](/docs/api/schemas/n/#namedoidcproviderid), required |  |

**Request body** (required)

- `application/x-www-form-urlencoded`: object
  - `logout_token` (string, required, max length 16384)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Valid scoped logout processed; no provider token returned. | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `403` | Model not allowed | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `404` | Feature disabled | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `409` | Stale version/base or configuration drift; reload and review, no mutation. | — |
| `422` | Invalid policy, duplicate active issuer/client, invalid local user or cross-field dependency. | — |
| `503` | Current configuration, storage, or bounded admission unavailable; no authority issued. | — |

