Regenerate backup codes.
POST
/api/auth/two-factor/backup-codes
const url = 'https://api.tradr.cloud/api/auth/two-factor/backup-codes';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example"}'};
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.tradr.cloud/api/auth/two-factor/backup-codes \ --header 'Content-Type: application/json' \ --data '{ "code": "example" }'Validates a current authenticator code (a backup code is NOT accepted here), then replaces every earlier backup code with 10 fresh single-use ones, shown once and stored only as one-way hashes. Requires an authenticated session; rate limited to 10 management writes per 15 minutes per user; never cached.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
Examplegenerated
{ "code": "example"}Responses
Section titled “ Responses ”The 10 new single-use backup codes, shown once.
Media typeapplication/json
object
backupCodes
Array<string>
Examplegenerated
{ "backupCodes": [ "example" ]}Validation error, or the code is wrong (INVALID_TWO_FACTOR_CODE).
No authenticated session.
Rate limit exceeded.