Otp Enable
Initiates two-factor authentication (2FA) setup by generating a new OTP secret and QR code for authenticator apps (Google Authenticator, Authy, etc.).
Endpoint
POST/v2/auth/otp/enable
Link
Request
Headers
Authorization
Bearer <JWT>
Yes
Content-Type
application/json
Yes
Accept
application/json
Yes
Request Body
No body required. Send an empty JSON object:
Response (200 OK)
Returns the OTP setup data for configuring an authenticator app.
Response Fields
qr
string
Base64-encoded QR code image. Scan with authenticator apps.
"data:image/png;base64,iVBORw0KGgo..."
secret
string
OTP secret key (manual entry option). 32-character alphanumeric.
"JBSWY3DPEHPK3PXP"
Example Response:
Next Steps
Scan QR Code with an authenticator app OR
Manually Enter Secret:
Verify Setup: Use
/v2/auth/otp/confirmwith a generated OTP code to activate 2FA.
Error Responses
2FA Already Enabled:
Invalid/Missing Token:
Notes
QR Code Usage:
The QR contains the
secret+ issuer info (e.g.,otpauth://totp/YourApp:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=YourApp).
Backup Codes: Generate separately via
/v2/auth/otp/backup-codesafter confirmation.Security:
Store the
secretsecurely (required for recovery).The QR/secret are valid for 10 minutes (confirm promptly).
Examples
Real request
Real response
Last updated

