Delete Images in Your Account

Deletes images in your account.

DELETE/v1.3/images

Images with active containers (CREATED, RUNNING, STOPPED, PAUSED) associated with them, cannot be deleted.

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 ParameterRequest Body Parameter

When specifying the request body:

Parameter

Mandatory/Optional

Data Type

Description

imageDeleteRequest

Mandatory

-

The user filters to query images or provide one or more image UUIDs to delete.

The 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

imageIds

Optional

array[string]

One or more image UUIDs for the images you want to delete.

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

filter

Optional

string

Filter the images 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 images to deleteSample 1 - Use the request body to specify images to delete

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

API request

    curl -X DELETE 
"<qualys_api_server_url>/csapi/v1.3/images" -d "{"imageIds":["e3e4cca0-8305-3835-810a-b334dcb65a33"]}" --header "Authorization: Bearer <token>"  
    

Response

    Returns {
    "deletionJobId": "980ce235-5677-4997-81ca-3905e63471bb"
}
response code 200
    

Error Response

The following error response is seen when the sub-users don't have permission to the specified images.

    {  
    "errorCode": "403 FORBIDDEN",  
    "message": "Request Forbidden",  
    "timestamp": 1700721586546
    }

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

In this sample, we’ll delete a single image by specifying the image UUID.

API request

    curl -X DELETE 
"<qualys_api_server_url>/csapi/v1.3/images?imageIds=8b261e4e-47f3-3b6a-a5a7-668ff0d6e3eb" --header "Authorization: Bearer <token>"
    

Response

    {
    "deletionJobId": "ee295423-af59-4f5c-a4a1-7cb035dae61b"
}
    

Error Response

The following error response is seen when the sub-users don't have permission to the specified images.

    {  
    "errorCode": "403 FORBIDDEN",  
    "message": "Request Forbidden",  
    "timestamp": 1700721586546
    }

Sample 3 - Delete multiple images using image UUIDsSample 3 - Delete multiple images using image UUIDs

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

API request

    curl -X DELETE 
"<qualys_api_server_url>/csapi/v1.3/images?imageIds=8b261e4e-47f3-3b6a-a5a7-668ff0d6e3eb&imageIds=9b251e3e-52f3-2b6a-a6a7-678ff0d5e2eb" --header "Authorization: Bearer <token>"
    

Response

    {
    "deletionJobId": "1b54a117-b413-4aa8-8511-61860487619c"
}
    

Error Response

The following error response is seen when the sub-users don't have permission to the specified images.

    {  
    "errorCode": "403 FORBIDDEN",  
    "message": "Request Forbidden",  
    "timestamp": 1700721586546
    }

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

In this sample, we’ll delete images based on the filter parameter.

API request

    curl -X DELETE
"<qualys_api_server_url>/csapi/v1.3/images?filter=imageId%3Aec3b4a64d481" 
--header "Authorization: Bearer <token>"
    

Response

    {
    "deletionJobId": "ee295423-af59-4f5c-a4a1-7cb035dae61b"
}
    

Error Response

The following error response is seen when the sub-users don't have permission to the specified images.

    {  
    "errorCode": "403 FORBIDDEN",  
    "message": "Request Forbidden",  
    "timestamp": 1700721586546
    }