Use this API to bulk delete registry schedules. You can delete one, multiple or all registry scan schedules in bulk.
This is especially useful when you have a large number of Finished or Canceled scans and want to bulk delete them so they no longer appear in your Scan Jobs list.
Provide a “filter” or a list of “scheduleIds” as part of the API request to identify the schedules you want to delete. When both are provided in the same request, then only the scheduleIds specified will be deleted.
Scan jobs with a status of Queued, Unknown, and Running cannot be deleted and will be ignored automatically. Cancel scan jobs first and then delete them.
You can:
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
registryId |
Mandatory |
string |
ID/UUID of the registry you want to delete the schedules for. |
scheduleIds |
Optional |
array[string] |
ID/UUIDs of the schedules you want to delete. When specifying multiple scheduleIds in the same request, enter them in this way: scheduleIds=value1&scheduleIds=value2&scheduleIds=value3, and so on. Scan jobs with a status of Queued, Unknown, and Running cannot be deleted and will be ignored automatically when part of the request. Cancel scan jobs first and then delete them. |
filter |
Optional |
string |
Filter the schedules list by providing a query using Qualys syntax. Refer to the “How to Search” topic in the online help for assistance with creating your query. |
In this sample, we’ll delete 2 schedules in the same request by specifying the schedule IDs.
API request
curl -X DELETE
"http://gateway.qg2.apps.qualys.com/csapi/v1.3/registry/0a1d9b9a-3bab-42ec-a894-4d5969a47616/schedule/bulk?scheduleIds=f677b189-8b54-46ba-9d24-624b7e98767d&scheduleIds=f677b189-8b54-46ba-9d24-624b7e98767d" --header "Authorization: Bearer <token>"
Response
{
"deletionJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
In this sample, we’ll use filter to delete all schedules with a status of Finished.
API request
curl -X DELETE
"http://gateway.qg2.apps.qualys.com/csapi/v1.3/registry/0a1d9b9a-3bab-42ec-a894-4d5969a476/schedule/bulk?scheduleIds=&filter=status%3AFinished" --header "Authorization: Bearer <token>"
Response
{
"deletionJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
In this sample, we’ll delete all schedules by using filter with scheduleUuid equal to * (%2A) in order to match all schedule IDs. (Scans with certain status levels will be skipped from this action.)
API request
curl -X DELETE
"http://gateway.qg2.apps.qualys.com/csapi/v1.3/registry/ea1e91f1-2686-45af-827f-2a2ec9ee4/schedule/bulk?scheduleIds=&filter=scheduleUuid%3A%2A" --header "Authorization: Bearer <token>"
Response
{
"deletionJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
Was this topic helpful?