For API version information, refer to the API Version History section.
The V3 API is designed to fetch only PC Asset data. To retrieve both PC and SCA Asset data, continue using API Versions V1 or V2.
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.
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 |
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>"
]
}
]
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>"
]
}
]
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>",
]
}
]
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.
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 |
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>"
]
}
]
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>"
]
}
]
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>",
]
}
]
The V3 API is designed to fetch only PC Asset data. To retrieve both PC and SCA Asset data, continue using API Versions V1 or V2.
This new version (/pcrs/3.0/posture/hostids) of this API enables to resolve hostIDs :
Previously, the policyID parameter was required in the API, but it is now optional. If a policy ID is not provided in the API request, the hosts are resolved for all policies within the subscription.
Important to know
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. |
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>"
]
}
]
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>"
]
}
]
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>",
]
}
]
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>,
]
}
]
The following table depicts the information about the different versions of this API along with the status:
API Version | API Status | Release Date |
/pcrs/1.0/posture/hostids? | To be deprecated | March 2025 |
/pcrs/2.0/posture/hostids? | To be deprecated | May 2025 |
/pcrs/3.0/posture/hostids? | Active | November 2024 |
Was this topic helpful?