# Console MFA API

Native console second factor (T086.002) - TOTP, passkeys and one-time recovery codes after the first factor. Pending-flow calls send X-MFA-Challenge; session calls send X-CSRF-Token.

## Own native MFA status

`GET /api/v1/admin/mfa` · operation `getNativeMFAStatus`

Any console role, browser session only (not Bearer). Safe projection of the session identity: effective method switches, whether policy requires MFA, confirmed factors without secrets, remaining recovery codes and the method that completed this session. Private/no-store.

**Authentication:** `adminSession`

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Own factor status | `application/json`: [NativeMFAStatus](/docs/api/schemas/n/#nativemfastatus) |
| `401` | Missing or invalid bearer key | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `503` | MFA state unavailable | — |


## Open a fresh-proof flow for a sensitive change

`POST /api/v1/admin/mfa/challenge` · operation `beginNativeMFAManageProof`

Authenticated session with a confirmed factor. Opens the session-bound flow; then POST /mfa/verify or the WebAuthn authenticate routes earn one single-use credit (fresh_proof_ttl) for removing a factor, replacing recovery codes or adding another factor. Never performs the change itself.

**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. |

**Request body** (required)

- `application/json`: object
  - `purpose` (string, required, one of `"manage"`)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Methods available for this proof | `application/json`: [NativeMFAChallenge](/docs/api/schemas/n/#nativemfachallenge) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Cancel the pending MFA sign-in

`POST /api/v1/admin/mfa/cancel` · operation `cancelNativeMFALogin`

Pending flow only. Retires this browser flow and clears its cookie; an earlier unrelated session, if still valid, becomes visible again. Does not revoke any session.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |

**Request body** (required)

- `application/json`: object

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Pending flow retired | — |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Verify a TOTP or one-time recovery code

`POST /api/v1/admin/mfa/verify` · operation `verifyNativeMFA`

With X-MFA-Challenge: completes the pending sign-in (verify stage) and issues the normal session cookie wrapped with the identity epoch and method; the response grants no role, permission or team. With a session and X-CSRF-Token: earns one fresh-proof credit. A TOTP timestep is accepted once across replicas; a recovery code (mfar_ + 43 base64url characters) is consumed once. Every attempt counts toward the shared lockout.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object
  - `method` (string, required, one of `"totp"`, `"recovery"`)
  - `code` (string, required, max length 64, write-only)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Session issued (pending) or credit granted (session) | `application/json`: [NativeMFAProof](/docs/api/schemas/n/#nativemfaproof) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Present an administrator reset ticket

`POST /api/v1/admin/mfa/enrollment-ticket` · operation `acceptNativeMFATicket`

Pending flow in the ticket stage (the identity was reset). The one-time mfae_ ticket from the administrator, together with the first factor already presented, moves the flow to the enroll stage. Counts toward the lockout.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |

**Request body** (required)

- `application/json`: object
  - `ticket` (string, required, max length 64, write-only)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Pending flow, now in the enroll stage | `application/json`: [NativeMFAPending](/docs/api/schemas/n/#nativemfapending) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Start authenticator-app enrollment

`POST /api/v1/admin/mfa/totp/begin` · operation `beginNativeTOTP`

Pending flow (enroll stage) or authenticated session (a fresh-proof credit is required when a factor already exists). Creates an encrypted pending factor and returns its secret, otpauth URI and a locally rendered QR code once (no-store). Requires local_totp and the provider encryption key. One authenticator app per identity.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One-time provisioning material | `application/json`: [NativeTOTPEnrollment](/docs/api/schemas/n/#nativetotpenrollment) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Activate the authenticator app with a current code

`POST /api/v1/admin/mfa/totp/confirm` · operation `confirmNativeTOTP`

Activates the pending factor and consumes that timestep. The first factor of an identity also returns the initial recovery batch once (local_mfa_recovery). In a pending flow it completes the sign-in; in a session it reissues the session cookie under the now-protected identity.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object
  - `factor_id` (string, required, pattern `^mfaf_[a-f0-9]{32}$`)
  - `code` (string, required, max length 16, write-only)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Factor activated | `application/json`: [NativeMFAProof](/docs/api/schemas/n/#nativemfaproof) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Remove the authenticator app

`DELETE /api/v1/admin/mfa/totp` · operation `removeNativeTOTP`

Session only; spends one fresh-proof credit. Advances the identity epoch, so every session proven earlier ends; the current browser is reissued unless no factor remains, which signs it out. Refused with 409 mfa_required when policy requires MFA and this is the last factor.

**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` | Factor removed | `application/json`: [NativeMFARemoval](/docs/api/schemas/n/#nativemfaremoval) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Passkey creation options

`POST /api/v1/admin/mfa/webauthn/register/options` · operation `beginNativePasskeyRegistration`

Pending flow (enroll stage) or session (fresh-proof credit when already enrolled). Requires local_webauthn and boot admin.local_mfa.webauthn rp_id/origins; user verification required, no attestation, existing credentials excluded. The ceremony is stored on the flow and answered once.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | PublicKeyCredentialCreationOptions wrapped in publicKey | `application/json`: object |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |

Response `200` fields:

- `application/json`: object
  - `publicKey` (object, required)


## Verify and activate a passkey

`POST /api/v1/admin/mfa/webauthn/register/finish` · operation `finishNativePasskeyRegistration`

Verifies RP ID, origin, ceremony type, challenge, user presence and user verification. Parser errors are never returned or logged. Same completion as TOTP confirm.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object
  - `name` (string, min length 1, max length 80)
  - `credential` (object, required) — Standard WebAuthn JSON (base64url binary fields)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Passkey activated | `application/json`: [NativeMFAProof](/docs/api/schemas/n/#nativemfaproof) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Passkey request options for the known identity

`POST /api/v1/admin/mfa/webauthn/authenticate/options` · operation `beginNativePasskeyAssertion`

Pending flow (verify stage) or session. There is no discoverable or passwordless login route: the allow list is the identity already identified by its first factor.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | PublicKeyCredentialRequestOptions wrapped in publicKey | `application/json`: object |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |

Response `200` fields:

- `application/json`: object
  - `publicKey` (object, required)


## Verify a passkey assertion

`POST /api/v1/admin/mfa/webauthn/authenticate/finish` · operation `finishNativePasskeyAssertion`

Verifies the assertion and user verification; a non-increasing nonzero signature counter is refused. Completes the pending sign-in or earns a fresh-proof credit.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `X-MFA-Challenge` | header | string | challenge_csrf_token of the pending MFA sign-in. Required for pending-flow calls (cancel, enrollment-ticket and the login stages); omit it to act as the authenticated session. |
| `X-CSRF-Token` | header | string | Session CSRF token, required when acting as the authenticated session rather than a pending flow. |

**Request body** (required)

- `application/json`: object
  - `credential` (object, required) — Standard WebAuthn JSON (base64url binary fields)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Session issued or credit granted | `application/json`: [NativeMFAProof](/docs/api/schemas/n/#nativemfaproof) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Remove an owned passkey

`DELETE /api/v1/admin/mfa/passkeys/{id}` · operation `removeNativePasskey`

Session only; spends one fresh-proof credit; same epoch and last-factor rules as removing the authenticator app.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required, pattern `^mfaf_[a-f0-9]{32}$` |  |
| `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` | Passkey removed | `application/json`: [NativeMFARemoval](/docs/api/schemas/n/#nativemfaremoval) |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |


## Replace the recovery batch

`POST /api/v1/admin/mfa/recovery-codes` · operation `replaceNativeRecoveryCodes`

Session only; spends one fresh-proof credit; requires a confirmed factor and local_mfa_recovery. Returns recovery_code_count new codes once; the previous batch is invalidated in the same transaction. Only hashes are stored.

**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. |

**Request body** (required)

- `application/json`: object

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | New one-time codes, shown once | `application/json`: object |
| `400` | Invalid input | `application/json`: [Error](/docs/api/schemas/e/#error) |
| `401` | Not authenticated, invalid_mfa_proof, or mfa_flow_invalid (expired pending flow: sign in again) | — |
| `403` | native_mfa_unavailable, mfa_method_unavailable, fresh_proof_required or CSRF failure | — |
| `409` | mfa_stage, mfa_state_changed, totp_exists, mfa_factor_limit, mfa_required, mfa_ceremony_missing or mfa_not_enrolled | — |
| `429` | mfa_locked: max_attempts failures for this identity within attempt_window, shared across methods and replicas; even a right proof is refused until the lockout ends | — |
| `503` | MFA state, encryption key or capacity unavailable | — |

Response `200` fields:

- `application/json`: object
  - `recovery_codes` (array of string, required, write-only)


## A named user's native MFA status

`GET /api/v1/admin/users/{id}/mfa` · operation `getUserNativeMFA`

Global administrator with native_mfa:manage. Counts only: no secret, credential or code. version is the user record version required by reset.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required |  |

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Target status | `application/json`: [NativeMFAUserStatus](/docs/api/schemas/n/#nativemfauserstatus) |
| `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` | Active user not found | — |
| `409` | version_conflict or mfa_not_enrolled | — |
| `503` | MFA state unavailable | — |


## Reset a named user's native MFA

`POST /api/v1/admin/users/{id}/mfa/reset` · operation `resetUserNativeMFA`

Global administrator with native_mfa:manage, current user version. Deletes the user's factors, recovery codes and pending flows, ends its sessions and leaves a restricted enrollment latch: the next sign-in needs the first factor plus the returned one-time mfae_ ticket (enrollment_ticket_ttl) to enroll a new factor. A reset never makes the identity first-factor-only. Audited as native_mfa.reset without the ticket.

**Authentication:** `adminSession`

**Parameters**

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string, required |  |
| `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, required, min 0)

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | One-time enrollment ticket, shown once | `application/json`: [NativeMFAReset](/docs/api/schemas/n/#nativemfareset) |
| `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` | Active user not found | — |
| `409` | version_conflict or mfa_not_enrolled | — |
| `503` | MFA state unavailable | — |


## Native console MFA policy

`GET /api/v1/admin/security/local-mfa` · operation `getLocalMFAPolicy`

Global administrator with native_mfa:manage. Declared YAML base, console override, effective policy, defaults, bounds, switch states, boot WebAuthn trust (read-only, restart required) and whether the provider encryption key is available.

**Authentication:** `adminSession`

**Responses**

| Status | Description | Body |
|---|---|---|
| `200` | Policy catalog | `application/json`: [LocalMFACatalog](/docs/api/schemas/l/#localmfacatalog) |
| `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` | No override to revert | — |
| `409` | version_conflict or base_changed (YAML base fingerprint) | — |
| `422` | invalid_local_mfa: out-of-bounds field, or a requirement that would protect the saving administrator without a usable method | — |
| `503` | Storage unavailable or committed policy synchronization pending | — |


## Replace the native console MFA policy

`PUT /api/v1/admin/security/local-mfa` · operation `putLocalMFAPolicy`

Complete canonical policy (every field, no nulls or unknown names) with the current global version and YAML base fingerprint. Subjects that become required are recorded with the database clock, so sessions issued earlier never revive after a later relaxation. WebAuthn trust is not part of this policy.

**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. |

**Request body** (required)

- `application/json`: object
  - `version` (integer, required, min 0)
  - `expected_base_fingerprint` (string, required, pattern `^[a-f0-9]{64}$`)
  - `local_mfa` ([LocalMFAPolicy](/docs/api/schemas/l/#localmfapolicy), required)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Policy committed and refreshed | — |
| `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` | No override to revert | — |
| `409` | version_conflict or base_changed (YAML base fingerprint) | — |
| `422` | invalid_local_mfa: out-of-bounds field, or a requirement that would protect the saving administrator without a usable method | — |
| `503` | Storage unavailable or committed policy synchronization pending | — |


## Revert the native console MFA policy to YAML

`DELETE /api/v1/admin/security/local-mfa` · operation `revertLocalMFAPolicy`

Removes the console override; both guards are required.

**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. |

**Request body** (required)

- `application/json`: object
  - `version` (integer, required, min 0)
  - `expected_base_fingerprint` (string, required, pattern `^[a-f0-9]{64}$`)

**Responses**

| Status | Description | Body |
|---|---|---|
| `204` | Override removed | — |
| `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` | No override to revert | — |
| `409` | version_conflict or base_changed (YAML base fingerprint) | — |
| `422` | invalid_local_mfa: out-of-bounds field, or a requirement that would protect the saving administrator without a usable method | — |
| `503` | Storage unavailable or committed policy synchronization pending | — |

