Remove machine learning models
Removes the specified machine learning models in a batch.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
DELETE /api/sonar/machine-learning/models
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d 'guids=["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]' \
-X DELETE \
https://HOSTNAME/api/sonar/machine-learning/models
Request Parameters
| Key | Required | Type | Description | Notes |
|---|---|---|---|---|
| guids | Yes | String list | List of machine learning model identifiers | Multiple GUIDs separated by , |
Success Response
{
"failures": []
}
- failures (Array): List of items that failed to be removed. Empty array when all succeed
- id (String): GUID of the model that failed to be removed
- name (String, optional): Model name
- reason (String): Failure reason
Error Responses
Identifier is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "guids should be not null"
}
Permission denied
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}