Setup OTP
POST
/web/v1/users/self/security/mfa/otp/setup JWTInitializes TOTP (Time-based One-Time Password) setup by generating a secret key and QR code URI for the user's authenticator app. The secret is only returned once.
Required Headers
| Header | Example Value | Description |
|---|---|---|
| Content-Type | application/json | Request content type |
| Accept | application/json | Expected response type |
| X-Client-Hash | Client device fingerprint | |
| Accept-Language | en, zh, zh-Hant, ja, vi | Response language (default: en) |
| Authorization | Bearer | JWT access token |
| X-SC-Session-Id | Secure channel session ID |
Request Parameters
No request parameters required.
Success Response
Success 200
{
"version": "1.3.0",
"timestamp": 1709337600000,
"success": true,
"code": "2000",
"message": "SUCCESS",
"data": {
"secret": "JBSWY3DPEHPK3PXP",
"qrCodeUri": "otpauth://totp/SlaunchX:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=SlaunchX",
"issuer": "SlaunchX",
"accountName": "user@example.com"
}
}Error Responses
Unauthorized 401
{
"success": false,
"code": "4010",
"message": "Invalid or expired token"
}Notes
- The secret and QR code URI are only returned once.
- After verification, the secret is encrypted and stored; it cannot be retrieved again.
- Rate limited to 5 requests per 300-second window.
- Use the QR code URI with any TOTP-compatible authenticator app.