Remove Pattern Groups

Deletes the specified pattern groups.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

DELETE /api/sonar/pattern-groups
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -X DELETE \
     "https://HOSTNAME/api/sonar/pattern-groups?guids=75c80aad-45d5-483a-b771-35bc4609dedc"
Request Parameters
KeyRequiredTypeDescriptionNote
guidsYesList (of strings)Pattern group GUID listComma-separated list

Success Response

{
  "failures": []
}
  • failures (Array): Items that failed to be deleted. An empty array when every item succeeds.
    • id (String): GUID of the pattern group that failed to be deleted
    • reason (String): Reason for the failure
Some pattern groups do not exist

A pattern group that does not exist is returned in the failures list.

{
  "failures": [
    {
      "id": "c1dfe306-abba-4ed8-862b-0e98e2effcb6",
      "reason": "pattern group not found: c1dfe306-abba-4ed8-862b-0e98e2effcb6"
    }
  ]
}

Error Responses

Pattern group is not found

HTTP status code 200

{
    "failures": [
        {
            "id": "c1dfe306-abba-4ed8-862b-0e98e2effcb6",
            "reason": "pattern group not found: c1dfe306-abba-4ed8-862b-0e98e2effcb6"
        }
    ]
}
No privileges to delete a pattern group

HTTP status code 500

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