Delete Asset

[POST] /qps/rest/2.0/delete/am/asset/<id>

[POST] /qps/rest/2.0/delete/am/asset

Delete one or more assets.

Using the NOT EQUALS operator for deleting assets could result in accidental deletion of unknown assets without any warning. To prevent accidental deletion of unknown assets, we do not support NOT EQUALS operator for delete actions.

Permissions required - Managers with full scope. Other users must have these permissions: Access Permission “API Access” and Asset Management Permission “Delete Asset”.

Input ParametersInput Parameters

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

id

Optional

integer

 

name

Optional

text

 

created

Optional

date

 

updated

Optional

date

 

type

Optional

keyword

UNKOWN, HOST, SCANNER, WEBAPP, MALWARE_DOMAIN

tagName

Optional

text

Parent tags of the tag will also match

tagId

Optional

text

Parent tags of the tag will also match

Sample - Delete assets with a particular tag nameSample - Delete assets with a particular tag name

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/2.0/delete/am/asset" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="tagName" operator="EQUALS">To Delete</Criteria>
    </filters>
</ServiceRequest>      
    

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/asset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>1972521</id>
        </Asset>
    </data>
</ServiceResponse>      
    

XSD

<platform API server>/qps/xsd/2.0/am/asset.xsd