Admin MFA (v1)
Method & Path
POST /api/v1/admin/mfa/totp/setup
POST /api/v1/admin/mfa/totp/confirm
POST /api/v1/admin/mfa/verify
GET /api/v1/admin/mfa/status
Description
Multi-factor authentication (MFA) endpoints for admin accounts. Admins can enable TOTP (Time-based One-Time Password) authentication using authenticator apps like Google Authenticator, Authy, or Microsoft Authenticator.
Authentication
Required: Admin authentication required for setup and status endpoints. No authentication required for verify endpoint (used during login flow).
Endpoints
Setup TOTP
POST /api/v1/admin/mfa/totp/setup
Generate a TOTP secret and QR code for admin account.
Headers
Authorization: Bearer <admin_access_token>
Content-Type: application/json
Response 200 OK
{
"otpauthUri": "otpauth://totp/Placio:admin@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Placio",
"qrCodeDataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
Response Fields
otpauthUri(string): URI for adding to authenticator appqrCodeDataUrl(string): Base64-encoded QR code image
Notes
- Secret is encrypted and stored securely (not returned in response)
- QR code can be scanned with any TOTP authenticator app
- Setup must be confirmed with
/totp/confirmendpoint
Confirm TOTP Enrollment
POST /api/v1/admin/mfa/totp/confirm
Confirm TOTP enrollment by verifying a code from the authenticator app.
Headers
Authorization: Bearer <admin_access_token>
Content-Type: application/json
Request Body
{
"totpCode": "123456"
}
Request Fields
totpCode(string, required): 6-digit TOTP code from authenticator app
Response 200 OK
{
"success": true,
"message": "TOTP method enrolled successfully"
}
Common Errors
- 400 Bad Request: Invalid TOTP code format or code doesn't match
- 401 Unauthorized: Admin authentication required
Verify MFA During Login
POST /api/v1/admin/mfa/verify
Verify MFA code during login flow after initial password authentication.