Activate 2FA on a user account

POST /users/{id}/settings/2fa

Returns OTP link and QR Code

Path parameters

  • id string(uuid) | string Required

Responses

  • 200 application/json

    OTP setup started

    Hide response attributes Show response attributes object
  • 400 application/json

    Error with transmitted information

    Hide response attribute Show response attribute object
POST /users/{id}/settings/2fa
curl \
 -X POST https://api.wan-host.com/users/920e4e75-3995-4056-a48d-a1c83ea9ea66/settings/2fa \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "uri": "otpauth://totp/Wan-Host:victor%40splrge.dev?secret=YXGQLDKVSSUEEBHTV3WAQYVVWTQXXR2H&issuer=Wan-Host&period=30&algorithm=SHA1&digits=6",
  "qr": "https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=otpauth://totp/Wan-Host:victor%40splrge.dev?secret=YXGQLDKVSSUEEBHTV3WAQYVVWTQXXR2H&issuer=Wan-Host&period=30&algorithm=SHA1&digits=6"
}
Response examples (400)
{
  "message": "TOTP is already configured"
}
{
  "message": "Wrong code"
}