For API version information, refer to the API Version History section.
Import a compliance policy, defined in an XML file, into your account. We’ll include all the service-provided controls from your XML file. You have the option to also include user defined controls.
Permissions - If you’re not a Manager, the permission to Manage PC module must be turned on in your account.
|
Parameter |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
|
action=import |
Required |
String |
Specifies the action type for importing the policy. |
|
echo_request={0|1} |
Optional |
Integer |
Specify 1 to view (echo) input parameters in the XML output. By default these are not included. |
|
xml_file |
Required |
File |
File containing the policy details. |
|
title={value} |
Required |
String |
The title of the new policy. |
|
create_user_controls={0|1} |
Optional |
Integer |
When not specified, user-defined controls are not created when you import a policy. Specify 1 to include UDCs from the XML file. |
API Request
https://<qualys_base_url>/api/2.0/fo/compliance/policy/?action=import&title=My+Policy"
XML Output
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2016-09-15T21:32:40Z</DATETIME>
<TEXT>Successfully imported compliance policy</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>136992</VALUE>
</ITEM>
<ITEM>
<KEY>TITLE</KEY>
<VALUE>My Policy</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl" -H Content-Type:text/xml --data-binary "@UDC_with_Remedy_20200422.xml" "https://<qualys_base_url>/api/2.0/fo/compliance/policy/?action=import&title=Policy1&create_user_controls=1"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM
"https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2020-04-22T22:51:16Z</DATETIME>
<TEXT>Successfully imported compliance policy</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>1867541</VALUE>
</ITEM>
<ITEM>
<KEY>TITLE</KEY>
<VALUE>Policy1</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
<platform API server>/api/2.0/simple_return.dtd
Import a compliance policy, defined in an XML file, into your account. We’ll include all the service-provided controls from your XML file. You have the option to also include userdefined controls.
Permissions - If you’re not a Manager, the permission to Manage PC module must be turned on in your account.
|
Parameter |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
|
action=import |
Required |
String |
Specifies the action type for importing the policy. |
|
echo_request={0|1} |
Optional |
Integer |
Specify 1 to view (echo) input parameters in the XML output. By default these are not included. |
|
xml_file |
Required |
File |
File containing the policy details. |
|
title={value} |
Required |
String |
The title of the new policy. |
|
create_user_controls={0|1} |
Optional |
Integer |
When not specified, user-defined controls are not created when you import a policy. Specify 1 to include UDCs from the XML file. |
API Request
curl -k -s -S -H 'X-Requested-With:curl demo2' -u "username:Password#" -H Content-type:text/xml --data-binary "@/home/location/Policy_V3sample.xml" "https://<qualys_base_url>/api/3.0/fo/compliance/policy/?action=import&title=V3sample"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/3.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2025-06-27T12:04:53Z</DATETIME>
<TEXT>Successfully imported compliance policy</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>5757988</VALUE>
</ITEM>
<ITEM>
<KEY>TITLE</KEY>
<VALUE>V3sample</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
Import a compliance policy, defined in an XML file, into your account. We’ll include all the service-provided controls from your XML file. You have the option to also include userdefined controls.
Permissions - If you’re not a Manager, the permission to Manage PC module must be turned on in your account.
|
Parameter |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
|
action=import |
Required |
String |
Specifies the action type for importing the policy. |
|
echo_request={0|1} |
Optional |
Integer |
Specify 1 to view (echo) input parameters in the XML output. By default these are not included. |
|
xml_file |
Required |
File |
File containing the policy details. |
|
title={value} |
Required |
String |
The title of the new policy. |
|
create_user_controls={0|1} |
Optional |
Integer |
When not specified, user-defined controls are not created when you import a policy. Specify 1 to include UDCs from the XML file. |
API Request
curl -k -s -S -H 'X-Requested-With:curl demo2' -u "quaylys_username:Password@" -H Content-type:text/xml --data-binary "<file_directory_path>/compliance/policy_import_api.xml" "https://<qualys_base_url>/api/4.0/fo/compliance/policy/?action=import&title=UDC_inactive_create_v4&create_user_controls=1"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/4.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2025-06-02T13:23:31Z</DATETIME>
<TEXT>Successfully imported compliance policy</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>1464127</VALUE>
</ITEM>
<ITEM>
<KEY>TITLE</KEY>
<VALUE>UDC_inactive_create_v4</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
The following table depicts the information about the different versions of this API along with the status:
| API Version | API Status | Release Date |
| /api/2.0/fo/compliance/policy/?action=import | To be deprecated | December 2025 |
| /api/3.0/fo/compliance/policy/?action=import | To be deprecated | Januray 2026 |
| /api/4.0/fo/compliance/policy/?action=import | Active | July 2025 |
Was this topic helpful?