Skip to content
These docs describe Tradr v0.17.0. Running an older release? Check the release notes for what changed.

Regenerate backup codes.

POST
/api/auth/two-factor/backup-codes
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.

Media typeapplication/json
object
code
required
string
>= 6 characters <= 20 characters
Examplegenerated
{
"code": "example"
}

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.