Create User Group

Creates a new user group.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

POST /api/sonar/user-groups
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d name="Cyber Security" \
     -X POST \
     https://HOSTNAME/api/sonar/user-groups
Request Parameters
KeyRequiredTypeDescriptionNote
nameYesStringUser group nameMinimum 1 to maximum 200 characters
guidNoStringUser group GUID36 characters
company_guidNoStringCompany GUID36 characters. Option only available for a cluster administrator
descriptionNoStringDescriptionMaximum 2,000 characters
user_guidsNoArrayUser identifier groupInvalid user identifier is ignored.

Success Response

{
  "guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Error Responses

name parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "name should be not null"
}
name or description parameter length is invalid

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'name' must be shorter than or equal to 200 characters."
}
guid is not a valid GUID

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "guid should be guid type."
}
user_guids is not in valid GUID format

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "user_guids should be guid type."
}
guid is duplicated

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicated user group guid: a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
name is duplicated

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicated user group name: Cyber Security"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}