Skip to content

Menu

POST /api/auth/two-factor/enable

No operationId in openapi.json · page id post-api-auth-two-factor-enable

Enable two factor authentication. Pass method 'totp' (default) to set up an authenticator app (returns TOTP URI and backup codes), or 'otp' to enable email/SMS-based codes immediately.

Authentication

Signed-in operator session (browser)

Actual native human session; protected management also requires recent successful factor authentication.

Request body

application/json

  • passwordstringrequired

    User password

  • method"otp" | "totp"
  • issuerstring

    Custom issuer for the TOTP URI

Responses

200 Successful response

  • method"otp" | "totp"required

    The 2FA method that was enabled.

  • totpURIstring

    TOTP URI for authenticator app setup. Only present when method is 'totp'.

  • backupCodesarray of string

    Recovery backup codes. Only present when method is 'totp'.

400 Bad Request. Usually due to missing parameters, or invalid parameters.

  • messagestringrequired

401 Unauthorized. Due to missing or invalid authentication.

  • messagestringrequired

403 Forbidden. You do not have permission to access this resource or to perform this action.

  • messagestring

404 Not Found. The requested resource was not found.

  • messagestring

429 Too Many Requests. You have exceeded the rate limit. Try again later.

  • messagestring

500 Internal Server Error. This is a problem with the server that you cannot fix.

  • messagestring

All operations

POST /api/auth/two-factor/enable · AgentLand