Generate recovery codes

PUT /auth/recovery-codes

Generate new recovery codes for two-factor authentication. It requires two-factor authentication verification.

application/json

Body Required

  • totp string

    TOTP verification code

  • email_otp string

    Email OTP verification code

  • fido_authentication_response object

    FIDO authentication response

  • recovery_code string

    Recovery code for two-factor authentication

Responses

  • 200

    New recovery codes generated

  • 400

    No two-factor authentication enabled or verification failed

PUT /auth/recovery-codes
curl \
 --request PUT 'http://api.example.com/auth/recovery-codes' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"totp":"string","email_otp":"string","fido_authentication_response":{},"recovery_code":"string"}'
Request examples
{
  "totp": "string",
  "email_otp": "string",
  "fido_authentication_response": {},
  "recovery_code": "string"
}