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

Begin two-factor enrolment.

POST
/api/auth/two-factor/enrol
curl --request POST \
--url https://api.tradr.cloud/api/auth/two-factor/enrol

Generates a fresh TOTP secret (at least 160 bits), stores it only as an encryption envelope in a pending row and returns the base32 secret and its otpauth:// URI once, for display as a text key and a QR code. Nothing turns on until POST /two-factor/enrol/confirm accepts a code. Requires an authenticated session; rate limited to 10 management writes per 15 minutes per user; never cached.

The enrolment secret and provisioning URI.

Media typeapplication/json
object
otpauthUri

The otpauth:// provisioning URI for a QR code.

string
secret

The base32 TOTP secret (text key).

string
Examplegenerated
{
"otpauthUri": "example",
"secret": "example"
}

No authenticated session.

Two-factor is already enabled (TWO_FACTOR_ALREADY_ENABLED).

Rate limit exceeded.