For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Key
Value
Required

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

Field
Type
Description
Example

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

  1. Scan QR Code with an authenticator app OR

  2. Manually Enter Secret:

  3. Verify Setup: Use /v2/auth/otp/confirm with a generated OTP code to activate 2FA.


Error Responses

  1. 2FA Already Enabled:

  2. 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-codes after confirmation.

  • Security:

    • Store the secret securely (required for recovery).

    • The QR/secret are valid for 10 minutes (confirm promptly).

Examples

Real request

Real response

Last updated