Resolve Host IDs

For API version information, refer to the API Version History section.

V1.0| V2.0| V3.0 | V4.0 | V5.0

The V5.0, V4.0, and V3.0 APIs is designed to fetch only PA/PC Asset data. To retrieve both PA/PC and SCA Asset data, continue using API Versions V1.0 or V2.0. If you want to enable V5.0, V4.0, or V3.0 to support SCA Asset data, contact your Technical Account Manager (TAM).

V1.0

GET/pcrs/1.0/posture/hostids?policyId=policyId1, policyId2

List all Host IDs for the specified policies.

For the Resolve Host IDs API, you must use the that is returned by the authentication request. You can include a maximum of 10 policies in one API request.

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

policyId={value}

Required

Integer 

The ID of the policy for which you want to resolve hosts.  You can specify a single policy or multiple/all the policies in your subscription using comma-separated values.

Request header:

Authorization

Required

String 

JWT encrypted .

Note: Provide the received from the Authorization API as the input.

lastScanDate={value}

Optional

Integer 

Get host IDs based on the specified date on which they were last scanned.

The formats for date are:

lastScanDate=YYYY-MM-DD

For example:

lastScanDate=2022-05-25

Or,

lastScanDate=2022-05-25T18:48:16Z

Sample -  Resolve Host IDsSample -  Resolve Host IDs

Resolve Host IDs With Single Policy ID

API Request

curl -X GET https://<qualys_base_url>/pcrs/2.0/posture/hostids?policyId=POLICY ID-H "accept:*/*"-H "Authorization: Bearer Token "

JSON Output

[
{
"policyId": "<POLICY ID>",
"subscriptionId": "SUBSCRIPTION ID",
"hostIds": [
"<HOST ID>"
]
}
]

Resolve Host IDs With Multiple Policy IDs

API Request

curl -X GET https://<qualys_base_url>/pcrs/1.0/posture/hostids?policyId=xxx,xxx-H "accept: */*"-H"Authorization: Bearer "

JSON Output

[
{
"policyId": "<POLICY ID>",
"subscriptionId": "<SUBSCRIPTION ID>",
"hostIds": [
"<HOST ID>"
]
},
{
"policyId": "<POLICY ID>",
"subscriptionId": "SUBSCRIPTION ID",
"hostIds": [
"<HOST ID>"
]
}
]

Resolve Host IDs Based on the Specified Last Scan Date

API Request

curl -X GET https://<qualys_base_url>/pcrs/1.0/posture/hostids?policyId=4677689&lastScanDate=2022-05-25-H "accept: */*"-H"Authorization: "

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "<SUBSCRIPTION ID>",
        "hostIds": [
            "<HOST ID 1>",
            "<HOST ID 2>",
            "<HOST ID 3>",
            "<HOST ID 4>",
            "<HOST ID 5>",
        ]
    }
]

V2.0

GET/pcrs/2.0/posture/hostids?policyId=policyId1, policyId2

List all Host IDs for the specified policies.

For the Resolve Host IDs API, you must use the that is returned by the authentication request. You can include a maximum of 10 policies in one API request.

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

policyId={value}

Required

Integer  The ID of the policy for which you want to resolve hosts. You can specify a single policy or multiple/all the policies in your subscription using comma-separated values.

Request header:

Authorization

Required

String 

JWT encrypted .

Note: Provide the received from the Authorization API as the input.

lastScanDate={value}

Optional

Integer 

Get host IDs based on the specified date on which they were last scanned.

The formats for date are:

lastScanDate=YYYY-MM-DD

For example:

lastScanDate=2022-05-25

Or,

lastScanDate=2022-05-25T18:48:16Z

Sample -  Resolve Host IDsSample -  Resolve Host IDs

Resolve Host IDs With Single Policy ID

API Request

curl -X GET https://<qualys_base_url>/pcrs/2.0/posture/hostids?policyId=POLICY ID-H "accept:*/*"-H "Authorization: Bearer Token "

JSON Output

[
{
"policyId": "<POLICY ID>",
"subscriptionId": "SUBSCRIPTION ID",
"hostIds": [
"<HOST ID>"
]
}
]

Resolve Host IDs With Multiple Policy IDs

API Request

curl -X GET https://<qualys_base_url>/pcrs/2.0/posture/hostids?policyId=xxx,xxx-H "accept: */*"-H"Authorization: Bearer "

JSON Output

[
{
"policyId": "<POLICY ID>",
"subscriptionId": "<SUBSCRIPTION ID>",
"hostIds": [
"<HOST ID>"
]
},
{
"policyId": "<POLICY ID>",
"subscriptionId": "SUBSCRIPTION ID",
"hostIds": [
"<HOST ID>"
]
}
]

Resolve Host IDs Based on the Specified Last Scan Date

API Request

curl -X GET https://<qualys_base_url>/pcrs/2.0/posture/hostids?policyId=4677689&lastScanDate=2022-05-25-H "accept: */*"-H"Authorization: "

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "<SUBSCRIPTION ID>",
        "hostIds": [
            "<HOST ID 1>",
            "<HOST ID 2>",
            "<HOST ID 3>",
            "<HOST ID 4>",
            "<HOST ID 5>",
        ]
    }
]

V3.0

GET/pcrs/3.0/posture/hostids?policyId=policyId1, policyId2

The V3.0 API is designed to fetch only PC Asset data. To retrieve both PC and SCA Asset data, continue using API Versions V1.0 or V2.0. If you want to enable V3.0 to support SCA Asset data, contact your Technical Account Manager (TAM).

This new version (/pcrs/3.0/posture/hostids) of this API enables to resolve hostIDs :

Important to know

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

policyId={value}

Optional

Integer 

The ID of the policy for which you want to resolve hosts. You can specify a single policy or multiple/all the policies in your subscription using comma-separated values.

If no Policy ID is provided in the API request, then the hosts are resolved for all the policies in the subscription.

Request header:

Authorization

Required

String 

JWT encrypted .

Note: Provide the received from the Authorization API as the input.

lastScanDate={value}

Optional

Integer 

Get host IDs based on the specified date on which they were last scanned.

The formats for date are:

lastScanDate=YYYY-MM-DD

For example:

lastScanDate=2022-05-25

Or,

lastScanDate=2022-05-25T18:48:16Z

statusChangedSince={value} Optional Date Specify the date to resolve the hosts with posture modified (failed or passed ) on or after the specified date.

Sample - Resolve Host IDsSample - Resolve Host IDs

Resolve Host IDs With Single Policy ID

API Request

curl -X GET https://<qualys_base_url>/pcrs/3.0/posture/hostids?policyId=POLICY ID-H "accept:*/*"-H "Authorization: Bearer Token "

JSON Output

[
{
"policyId": "<POLICY ID>",
"subscriptionId": "SUBSCRIPTION ID",
"hostIds": [
"<HOST ID>"
]
}
]

Resolve Host IDs With Multiple Policy IDs

API Request

curl -X GET https://<qualys_base_url>/pcrs/3.0/posture/hostids?policyId=xxx,xxx-H "accept: */*"-H"Authorization: Bearer Token "

JSON Output

[
{
"policyId": "<POLICY ID>",
"subscriptionId": "<SUBSCRIPTION ID>",
"hostIds": [
"<HOST ID>"
]
},
{
"policyId": "<POLICY ID>",
"subscriptionId": "SUBSCRIPTION ID",
"hostIds": [
"<HOST ID>"
]
}
]

Resolve Host IDs Based on the Specified Last Scan Date

API Request

curl -X GET https://<qualys_base_url>/pcrs/3.0/posture/hostids?policyId=4677689&lastScanDate=2022-05-25-H "accept: */*"-H"Authorization:Bearer Token "

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "<SUBSCRIPTION ID>",
        "hostIds": [
            "<HOST ID 1>",
            "<HOST ID 2>",
            "<HOST ID 3>",
            "<HOST ID 4>",
            "<HOST ID 5>",
        ]
    }
]

Sample- Resolve hostIDs based on the specific posture modification dateSample- Resolve hostIDs based on the specific posture modification date

API Request

curl -X GET https://gateway/pcrs/3.0/posture/hostids?policyId=<Policy_ID>& statusChangedSince= <Date>
-H "accept: */*" -H "Authorization: Bearer Token" 

JSON Output

[
    {
        "policyId": <Policy_ID>,
        "subscriptionId": <Subscription_id>,
        "hostIds": [
            <Host_IDs>,
            <Host_IDs>,
            <Host_IDs>,
        ]
    }
]

 

V4.0

GET/pcrs/4.0/posture/hostids?policyId=policyId1, policyId2

The V4.0 and V3.0 APIs is designed to fetch only PA/PC Asset data. To retrieve both PA/PC and SCA Asset data, continue using API Versions V1.0 or V2.0. If you want to enable V4.0 or V3.0 to support SCA Asset data, contact your Technical Account Manager (TAM).

This new version (/pcrs/4.0/posture/hostids) of this API enables to resolve hostIDs :

Important to know

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

policyId={value}

Optional

Integer 

The ID of the policy for which you want to resolve hosts. You can specify a single policy or multiple/all the policies in your subscription using comma-separated values.

If no Policy ID is provided in the API request, then the hosts are resolved for all the policies in the subscription.

Request header:

Authorization

Required

String 

JWT encrypted .

Note: Provide the received from the Authorization API as the input.

lastScanDate={value}

Optional

Integer 

Get host IDs based on the specified date on which they were last scanned.

The formats for date are:

lastScanDate=YYYY-MM-DD

For example:

lastScanDate=2022-05-25

Or,

lastScanDate=2022-05-25T18:48:16Z

statusChangedSince={value} Optional Date Specify the date to resolve the hosts with posture modified (failed or passed ) on or after the specified date.

Sample - Resolve Host IDsSample - Resolve Host IDs

Resolve Host IDs With Single Policy ID

API Request

curl -X GET <qualys_base_url>/pcrs/4.0/posture/hostids?policyId=POLICY ID-H "accept:*/*"-H "Authorization: Bearer Token "

JSON Output

[
  {
    "policyId": "<POLICY ID>",
    "subscriptionId": "SUBSCRIPTION ID",
    "hostIds": [
      "<HOST ID>"
    ]
  }
]

Resolve Host IDs With Multiple Policy IDs

API Request

curl -X GET <qualys_base_url>/pcrs/4.0/posture/hostids?policyId=xxx,xxx-H "accept: */*"-H"Authorization: Bearer Token "

JSON Output

[
  {
    "policyId": "<POLICY ID>",
    "subscriptionId": "<SUBSCRIPTION ID>",
    "hostIds": [
      "<HOST ID>"
    ]
  },
  {
    "policyId": "<POLICY ID>",
    "subscriptionId": "SUBSCRIPTION ID",
    "hostIds": [
      "<HOST ID>"
    ]
  }
]

Resolve Host IDs Based on the Specified Last Scan Date

API Request

curl -X GET <qualys_base_url>/pcrs/4.0/posture/hostids?policyId=4677689&lastScanDate=2022-05-25-H "accept: */*"-H"Authorization:Bearer Token "

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "<SUBSCRIPTION ID>",
        "hostIds": [
            "<HOST ID 1>",
            "<HOST ID 2>",
            "<HOST ID 3>",
            "<HOST ID 4>",
            "<HOST ID 5>",
        ]
    }
]

Sample- Resolve hostIDs based on the specific posture modification dateSample- Resolve hostIDs based on the specific posture modification date

API Request

curl -X GET <qualys_base_url>/pcrs/4.0/posture/hostids?policyId=<Policy_ID>& statusChangedSince= <Date>
-H "accept: */*" -H "Authorization: Bearer Token" 

JSON Output

[
    {
        "policyId": <Policy_ID>,
        "subscriptionId": <Subscription_id>,
        "hostIds": [
            <Host_IDs>,
            <Host_IDs>,
            <Host_IDs>,
        ]
    }
]


V5.0

GET/pcrs/5.0/posture/hostids?policyId=policyId1, policyId2

The V5.0, V4.0, and V3.0 APIs is designed to fetch only PA/PC Asset data. To retrieve both PA/PC and SCA Asset data, continue using API Versions V1.0 or V2.0. If you want to enable V5.0, V4.0, or V3.0 to support SCA Asset data, contact your Technical Account Manager (TAM).

This new version (/pcrs/5.0/posture/hostids) of this API enables to resolve hostIDs :

Important to know

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

policyId={value}

Optional

Integer 

The ID of the policy for which you want to resolve hosts. You can specify a single policy or multiple/all the policies in your subscription using comma-separated values.

If no Policy ID is provided in the API request, then the hosts are resolved for all the policies in the subscription.

Request header:

Authorization

Required

String 

JWT encrypted .

Note: Provide the received from the Authorization API as the input.

lastScanDate={value}

Optional

Integer 

Get host IDs based on the specified date on which they were last scanned.

The formats for date are:

lastScanDate=YYYY-MM-DD

For example:

lastScanDate=2022-05-25

Or,

lastScanDate=2022-05-25T18:48:16Z

statusChangedSince={value} Optional Date Specify the date to resolve the hosts with posture modified (failed or passed ) on or after the specified date.
assetDeploymentType No String Filter by asset deployment type: ON-PREM, CLOUD, or ALL.
assetState No String Filter by asset state: TERMINATED, ACTIVE, or ALL.

Asset Filter ChangesAsset Filter Changes

  1. The API supports filtering by assetDeploymentType (CLOUD, ON-PREM, ALL).
    1. Cloud Assets
      1. Identified using integration with connectors (AWS, Azure, GCP).
      2. Deployment type is automatically classified as CLOUD.
    2. On-Premises Assets
      1. Identified by IP, hostname, or agent installation within corporate datacenters.
      2. Assets not mapped to a cloud provider are categorized as ON-PREM.
      3. For On-Prem assets, state information is not tracked. If assetDeploymentType=ON-PREM is selected, the assetState (see below) filter is ignored.
  2. The API supports filtering by assetState (ACTIVE, TERMINATED, ALL). Each cloud provider (AWS, Azure, GCP) exposes multiple lifecycle states, such as, RUNNING, STOPPED, DEALLOCATED, and TERMINATED. To keep API usage consistent, we normalize them into three categories:
    1. ACTIVE - Hosts that are not decommissioned are considered active.
    2. TERMINATED - Host is permanently deleted or decommissioned, not expected to return.
    3. ALL - Includes every state, for broader queries.

assetState filter is only applicable for cloud assets.

Sample - Resolve Host IDsSample - Resolve Host IDs

Resolve Host IDs With Single Policy ID

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=POLICY ID-H "accept:*/*"-H "Authorization: Bearer Token "

JSON Output

[
  {
    "policyId": "<POLICY ID>",
    "subscriptionId": "SUBSCRIPTION ID",
    "hostIds": [
      "<HOST ID>"
    ]
  }
]

Resolve Host IDs With Multiple Policy IDs

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=xxx,xxx-H "accept: */*"-H"Authorization: Bearer Token "

JSON Output

[
  {
    "policyId": "<POLICY ID>",
    "subscriptionId": "<SUBSCRIPTION ID>",
    "hostIds": [
      "<HOST ID>"
    ]
  },
  {
    "policyId": "<POLICY ID>",
    "subscriptionId": "SUBSCRIPTION ID",
    "hostIds": [
      "<HOST ID>"
    ]
  }
]

Resolve Host IDs Based on the Specified Last Scan Date

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2022-05-25-H "accept: */*"-H"Authorization:Bearer Token "

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "<SUBSCRIPTION ID>",
        "hostIds": [
            "<HOST ID 1>",
            "<HOST ID 2>",
            "<HOST ID 3>",
            "<HOST ID 4>",
            "<HOST ID 5>",
        ]
    }
]

Sample- Resolve hostIDs based on the specific posture modification dateSample- Resolve hostIDs based on the specific posture modification date

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=<Policy_ID>& statusChangedSince= <Date>
-H "accept: */*" -H "Authorization: Bearer Token" 

JSON Output

[
    {
        "policyId": <Policy_ID>,
        "subscriptionId": <Subscription_id>,
        "hostIds": [
            <Host_IDs>,
            <Host_IDs>,
            <Host_IDs>,
        ]
    }
]

Sample - Retrieve all active cloud assets for a given policySample - Retrieve all active cloud assets for a given policy

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2025-08-25&assetDeploymentType=CLOUD&assetState=ACTIVE ' \-H 'accept: */*' -H 'Authorization: Bearer <AuthToken> 

JSON Output

[
 {
  "policyId": "4677689",
        "subscriptionId": "41",
        "hostIds": [
            "924781",
            "724905"
        ]
    }
]

Sample - Retrieve cloud assets that are permanently decommissionedSample - Retrieve cloud assets that are permanently decommissioned

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2025-08- 25&assetDeploymentType=CLOUD&assetState=TERMINATED ' \
-H 'accept: */*' -H 'Authorization: Bearer <AuthToken>’ 

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "41",
        "hostIds": [
            "504718”
        ]
    }
]

Sample - For On-Premises assets, state is not trackedSample - For On-Premises assets, state is not tracked

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2025-08-25&assetDeploymentType=ON-PREM' \
-H 'accept: */*' -H 'Authorization: Bearer <AuthToken>’ 

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "41",
        "hostIds": [
            "3001",
            "3002",
            "3003"      
        ]
    }
]

Sample - deploymentType and assetState fields are omittedSample - deploymentType and assetState fields are omitted

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2025-08- 25 ' \
-H 'accept: */*' -H 'Authorization: Bearer <AuthToken>’

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "41",
        "hostIds": [
            "924781",
            "724905",
            "504718",
        ]
    }
]

Sample - deploymentType is set to ALL and assetState is ACTIVESample - deploymentType is set to ALL and assetState is ACTIVE

API Request

curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2025-08- 25&assetDeploymentType=ALL&assetState=ACTIVE ' \
-H 'accept: */*' -H 'Authorization: Bearer <AuthToken>’
OR 
curl -X GET <qualys_base_url>/pcrs/5.0/posture/hostids?policyId=4677689&lastScanDate=2025-08- 25&assetState=ACTIVE ' \
-H 'accept: */*' -H 'Authorization: Bearer <AuthToken>’

JSON Output

[
    {
        "policyId": "4677689",
        "subscriptionId": "41",
        "hostIds": [
            "924781",
            "724905",
            "3001",
            "3002",
            "3003"      
        ]
    }
]

API Version History

The following table depicts the information about the different versions of this API along with the status:

API Version EOS EOL
/pcrs/5.0/posture/hostids? Active Active
/pcrs/4.0/posture/hostids? Active Active
/pcrs/3.0/posture/hostids? Active Active
/pcrs/2.0/posture/hostids? Active Active
/pcrs/1.0/posture/hostids? Active Active

Related Topics

PC Posture Streaming APIs

Get Policy IDs

Get Posture Info

 

 

success Thank you! We're glad to hear that this topic was useful.
success We appreciate your feedback. We'll work to make this topic better for you in the future.