Two-Factor (TOTP)
Confirm and enable 2FA
POST
/api/v1/auth/totp/confirmVerifies the first code from the authenticator app and turns on two-factor authentication. Returns a one-time set of backup codes.
Requires Authorization
Credential check
Body parameters
codestringrequired | 6-digit code from the authenticator app. |
Notes
- Backup codes are shown once — store them somewhere safe. Each one can be used a single time in place of a TOTP code.
Request
curl --request POST \
--url https://api.swiftgoma.com/api/v1/auth/totp/confirm \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"code": "482913"
}'200Example response
{
"success": true,
"data": {
"enabled": true,
"backupCodes": [
"7K2M-9QXZ",
"P4RT-6VDC",
"L1WY-3JFB",
"H8NQ-0ZKS",
"D5GE-2MTA"
]
}
}