Regenerate the 10 recovery codes and invalidate the previous ones
POST
/v1/me/totp/recovery-codes
const url = 'https://api.replifier.com/v1/me/totp/recovery-codes';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.replifier.com/v1/me/totp/recovery-codesRequires a two-factor session (403 mfa_required) that passed its last factor less than 10 minutes ago (403 reauth_required). 409 totp_not_enabled if TOTP is not active.
Responses
Section titled “Responses”New codes (shown only this once)
Media typeapplication/json
object
recoveryCodes
required
Array<string>
Example generated
{ "recoveryCodes": [ "example" ]}No session, expired session, or invalid, expired or revoked API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}Conflict
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}Internal error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string
Example
{ "error": { "code": "not_found" }}