Create pattern group

Creates a new pattern group.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

POST /api/sonar/pattern-groups
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d name="Webshell" \
     -X POST \
     https://HOSTNAME/api/sonar/pattern-groups
Request Parameters
KeyRequiredTypeDescriptionNote
guidNoStringPattern group GUID36 characters. Randomly generated if not specified.
nameYesStringPattern group nameMaximum 50 characters
descriptionNoStringPattern group descriptionMaximum 50 characters

Success Response

{
  "guid": "28ad21b2-585c-4b68-9fad-b78711078496"
}
  • guid (String): GUID of the created pattern group

Error Responses

Required argument is missing

HTTP status code 400.

{
    "error_code": "null-argument",
    "error_msg": "name should be not null"
}
Invalid argument length

HTTP status code 400.

{
    "error_code": "invalid-argument",
    "error_msg": "'name' must be shorter than or equal to 50 characters."
}
Duplicate pattern group name

HTTP status code 500 .

{
    "error_code": "illegal-state",
    "error_msg": "duplicated pattern group name: Webshell"
}
No privilege to create a pattern group

HTTP status code 500 .

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