Confirm 2FA activation on a user account

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

Returns the backup codes

Path parameters

  • id string(uuid) | string Required
application/json

Body Required

  • code string

    Format should match the following pattern: ^\d{6}$.

Responses

  • 400 application/json

    Error with transmitted information

    Hide response attribute Show response attribute object
  • 200 application/json

    OTP setup success

    Hide response attribute Show response attribute object
PATCH /users/{id}/settings/2fa
curl \
 -X PATCH https://api.wan-host.com/users/920e4e75-3995-4056-a48d-a1c83ea9ea66/settings/2fa \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"code":"684254"}'
Request example
{
  "code": "684254"
}
Response examples (400)
{
  "message": "TOTP is already configured"
}
{
  "message": "Wrong code"
}
Response examples (200)
{
  "backup": [
    "mv4u3mi6o463uhunlp4g96jx"
  ]
}