Get a List of All Patch Management Assets

Using this API, you can get a list of more than ten thousand assets enabled for your Patch Management subscription. 

POST/pm/v1/assets

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

searchAfter

Optional

string

Specify the searchAfter parameter to search for results after that. This is a combination of an asset_name and asset_id separated by a comma.

sortOrder

Optional

string

Specify the order to sort asset_name and asset_id.

pageSize

Optional

string

Specify the number of rows to be displayed per page.

platform

Optional

string

Specify the platform type.

Example: Windows and Linux

Sample - Get a List of all Patch Management Assets with Windows PlatformSample - Get a List of all Patch Management Assets with Windows Platform

API request

    
        curl -X 'POST' \
  '<qualys_base_url>/pm/v1/assets?sortOrder=ASC&platform=Windows' \
  -H 'accept: application/json' \
  -H 'searchAfter: PMUI_AUTOMATION_ASSET_WINDOWS_EXCLUSION,ecd86069-c015-4b0e-9488-8ef14a99026d' \
  -H 'Authorization: Bearer <Bearer_Token>' \
  -H 'Content-Type: application/json' \
  -d '{
"query": "installedPatchCount>1",
"havingQuery": "downloadMethod:AcquireFromVendor and rebootRequired:true",
"attributes": "name,id,platform"}' 

Response

    
        [
  {
    "platform": "Windows",
    "name": "PMUI_AUTOMATION_MOCK_ASSET_WINDOWS_1",
    "id": "e6eaf17a-3069-4c1e-a5dc-df0049cb9f60"
  },
  ...
  {
    "platform": "Windows",
    "name": "PMUI_AUTOMATION_MOCK_ASSET_WINDOWS_5",
    "id": "f87461bc-16ad-4621-97ef-c496676815da"
  }
]
    

Sample - Get a List of All Patch Management Linux AssetsSample - Get a List of All Patch Management Linux Assets

API Request

curl -X 'POST' \
  '<qualys_base_url>/pm/v1/assets?sortOrder=ASC&platform=Linux' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <<jwt token>>’\
  -H 'Content-Type: application/json' \
  -d 

API Response

[{
    "interfaces": [
      {
        "ipv6Address": "fe80:0:0:0:1dcc:3a12:56d8:73f"
      },
      {
        "address": "10.0.203.124"
      }
    ],
    "scanStatus": "Scanned",
    "operatingSystem": "Red Hat Enterprise Linux Server 9.2",
    "version": "9.2",
    "platform": "Linux",
    "tags": [
      "236bdc33-a0c7-4baf-8ce3-fc89ad5302ce",
      "6d1cd4b6-378d-4c95-ad47-f459882e7c35",
      "7f14573f-b7b7-4393-8457-d1a10f058a5a",
      "1e7aaeae-62fa-4e6c-82c5-99038fc8203b",
      "ce1e4d6a-7119-4177-9bcc-0b31c39aad1b"
    ],
    "installedPatchCount": 1,
    "missingPatches": [
      {
        "id": "fb9f585c-5773-30b6-8922-274e47a80ebc"
      },
      {
        "id": "cdbdb949-5153-3511-9f54-eced744470ec"
      },
      {
        "id": "8f378f67-98d3-30a3-bcff-ff6eda730f46"
      },
      {
        "id": "5b4c8d77-f012-3494-80e2-fa4fb5c2bcd4"
      },
      {
        "id": "87c17496-7b00-3652-99b9-ef28cc4adf0d"
      }
    ],
    "osIdentifier": "RHEL9",
    "missingPatchCount": 5,
    "activatedModules": [
      "PM"
    ],
    "lastLoggedOnUser": "",
    "scanDateTime": 1752821490000,
    "statusDateTime": 1752821490000,
    "name": "PMUI_AUTOMATION_MOCK_ASSET_LINUX",
    "agentVersion": "009.002.000.000",
    "id": "9bf5e773-177e-467c-a79a-1c345546be32",
    "installedPatches": [
      "5e4ebe5d-9d46-3945-aa8b-36e123075b5a"
    ],
    "hardware": {},
    "architecture": "x86_64",
    "status": "Scanned",
    "statusCode": 20211,
    "osNotSupportedForModules": []
  }
]