List Centralized Policies

Retrieves a list of policies from your account.

GET/csapi/v1.3/centralizedPolicy

Input ParametersInput Parameters

Parameter Mandatory/Optional Data Type Description
filter Optional string Filter the policies by providing a QQL search query.
pageNumber Optional integer Specify the page to be returned. 
pageSize Optional integer Specify the number of records to display per page.
sort Optional string Sort the records in the response using a QQL token.
filter Optional string Indicates the policy tag name assigned to the centralized policies.
New value:
policy.tags.name: <tag name>

Sample: List All Policies from Your AccountSample: List All Policies from Your Account

API Request

curl -X "GET"
"<qualys_base_url>/csapi/v1.3/centralizedPolicy?pagenumber=1&pageSize=20"
-H "accept: application/json"
-H "Authorization: Bearer <Token>"

Response

{
"data": [
          {
           "uuid": "d4229359-90f0-41aa-89c1-7c0b8e9b21c3",
           "policyName": "rd",
           "description": "Research oriented policy",
           "policyMode": "ACTIVE",
           "createdBy": "jack_reader",
           "created": "1712202970196",
           "updatedBy": "jack_reader",
           "updated": "1712202970196",
           "policyType": "CICD",
           "isDefault": false
          },
          {
           "uuid": "73b43bbc-a210-4885-bca8-79f6136b6189",
           "policyName": "NAMEPSACE",
           "description": "Namespace level policy",
           "policyMode": "ACTIVE",
           "createdBy": "jack_reader",
           "created": "1712042938140",
           "updatedBy": "jack_reader",
           "updated": "1712135573628",
           "policyType": "K8S_ADMISSION_CONTROLLER",
           "isDefault": false
          }
        ],
    "count": 1,
    "groups": {}
}

Sample: List All Policies from Your Account using Policy tag NameSample: List All Policies from Your Account using Policy tag Name

API Request

 curl -X 'GET' \  
'<qualys_base_url>/csapi/v1.3/centralizedPolicy?filter=policy.tags.name:"tag a1"&pageNumber=1&pageSize=50&sort=created%3Adesc'\ 
-H 'accept: application/json' \  
-H 'Authorization: Bearer <token> 

Response

    {  "data": 
[   {   "uuid": "279d9326-9e11-4d32-a8ff-b0480efb521e",      
        "policyName": "test1",      
        "description": "",      
        "policyMode": "ACTIVE",      
        "createdBy": "john_doe",      
        "created": "1751350525902",      
        "updatedBy": "john_doe",      
        "updated": "1751350525902",      
        "policyType": "CICD",      
        "isDefault": false,      
        "assignedTags": [        
{       "uuid": "3b0ce1e8-eef0-4c6b-90a3-7d2ec4b1ffa2",          
        "id": 153722692,          
        "name": "tag a1",          
        "backgroundColor": "#000000",          
        "foregroundColor": "#000000",          
        "icon": "",          
        "criticalityScore": 0,          
        "tagType": null        
}      
]    
}  ],  
"count": 1,  
"groups": {},  
"aggs": null
}