Delete Sensors in Your Account

Deletes sensors in your account.

DELETE/v1.3/sensors

You can only delete sensors with UNKNOWN status.

You can choose to provide a request body without parameters or you can specify UUIDs or filter as input parameters in the API request.

Request Body ParametersRequest Body Parameters

When specifying the request body:

Parameter

Mandatory/Optional

Data type

Description

sensorDeleteRequest

Mandatory

string

User filters to query sensors or provide one or more sensor UUIDs to delete.

Filter can be applied by providing a query using Qualys syntax.

Refer to the “How to Search” topic in the online help for assistance with creating your query.

Input ParametersInput Parameters

When specifying input parameters as part of the path:

Parameter

Mandatory/Optional

Data type

Description

sensorIds

Optional

array[string]

One or more sensor UUIDs for the sensors you want to delete.

When specifying multiple sensors in the same request, enter them in this way: sensorIds=value1&sensorIds=value2&sensorIds=value3, and so on.

filter

Optional

string

Filter the sensors 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.

Sample 1 - Use the request body to specify sensors to deleteSample 1 - Use the request body to specify sensors to delete

In this sample, a request body is used as part of the API request.

API request

    curl -X DELETE 
"<qualys_base_url>/csapi/v1.3/sensors" -d "{"filter":"hostname:cms"}' --header 'Authorization: Bearer <token>"   
    

Response

    Returns {
    "deletionJobId": "bbaac4c7-6263-4e2f-b391-bcb032975206"
}
response code 200
    

Sample 2 - Delete a single sensor using sensor UUIDSample 2 - Delete a single sensor using sensor UUID

In this sample, we will delete a single sensor by specifying the sensor UUID.

API request

    curl -X DELETE 
"<qualys_base_url>/csapi/v1.3/sensors?sensorIds=dba55718-736b-4bac-ae9a-38bb59643b45" --header "Authorization: Bearer <token>"
    

Response

    {
    "deletionJobId": "8b04c56a-33ad-44ba-a128-fc643b0af3c7"
}
    

Sample 3 - Delete multiple sensors using sensor UUIDsSample 3 - Delete multiple sensors using sensor UUIDs

In this sample, we’ll delete 2 sensors in the same request. Specify multiple sensors by entering sensorIds=value1&sensorIds=value2, and so on.

API request

    curl -X DELETE 
"<qualys_base_url>/csapi/v1.3/sensors?sensorIds=dba55718-736b-4bac-ae9a-38bb59643b45&sensorIds=bcd55718-736b-3bac-ae7a-34bb59644b32" --header "Authorization: Bearer <token>"
    

Response

    {
    "deletionJobId": "6e04c56a-42ad-44ba-a678-fc642b0af3c9"
}
    

Sample 4 - Delete sensors using a filterSample 4 - Delete sensors using a filter

In this sample, we will delete sensors based on the filter parameter.

API request

    curl -X DELETE 
"<qualys_base_url>/csapi/v1.3/sensors?filter=sensorId%3A4f97332e3a23" --header "Authorization: Bearer <token>"
    

Response

    {
    "deletionJobId": "7a93e37e-b2c6-40ac-8f18-70f87fcf3957"
}