Regenerate the caller's recovery codes
/v1/auth/mfa/recovery-codes/regenerateIssues a fresh batch of ten single-use recovery codes for the authenticated administrator, retiring every unused code of the previous batch, and returns the plaintext codes with the new recovery_codes_generation; they cannot be retrieved again. Requires a valid step-up token in the x-mfa-step-up-token header. Writes user.mfa.recovery_codes.regenerated and emails the account holder. Rate-limited to 5 requests per minute.
Authentication
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
Headers
x-mfa-step-up-tokenrequiredThe step-up token `POST /v1/auth/mfa/step-up` returned, proving a second factor was answered moments ago for this administrator
Responses
application/json
data *MfaRecoveryCodesResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Rate limit
Returned object
curl -X POST "https://auth.canopy-io.com/v1/auth/mfa/recovery-codes/regenerate" \ -H "x-mfa-step-up-token: value" \ -H "Authorization: Bearer $CANOPY_TOKEN"
{ "data": { "recovery_codes": [ "ABCD-EFGH-IJKL-MNOP", "QRST-UVWX-YZ23-4567", "..." ], "recovery_codes_generation": 0 } }
Tell us how we can improve this guide.