Enable MFA
Enables multi-factor authentication (MFA) for the specified account.
Required Permissions
Requires the ADMIN role or higher. You cannot apply this action to a user with higher privileges than yourself.
HTTP Request
POST /api/sonar/users/:guid/mfa/enable
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-X POST https://HOSTNAME/api/sonar/users/a1b2c3d4-e5f6-7890-abcd-ef1234567890/mfa/enable
Request Parameters
Path Parameters
| Key | Type | Description | Notes |
|---|---|---|---|
| guid | String | Account identifier | 36-character GUID |
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "guid should be not null"
}
User identifier is not in valid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
User is not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "user-not-found"
}
MFA type is not set
HTTP status code 500. To enable MFA, the target account must have an MFA type set first.
{
"error_code": "illegal-state",
"error_msg": "mfa-type-is-not-set"
}
Apply to a user with higher privileges
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}