> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-api/cortex-platform/asset-groups.md).

# Asset Groups

APIs for managing asset groups

## Get all or filtered asset groups

> By grouping assets based on shared attributes, you can address them collectively. Asset groups enable more efficient bulk actions and simplifies both filtering and scoping within the inventory and across the platform.\
> \
> Get all or filtered asset groups.\
> \
> \*\*Required license:\*\* Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Asset groups","description":"APIs for managing asset groups"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/asset-groups":{"post":{"tags":["Asset groups"],"operationId":"post-public_api-v1-asset-groups-get","parameters":[{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/assetgroups_body"}}}},"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericApiResponse"}}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UnauthorizedErrorResponse"}}}}},"500":{"description":"Internal Server Error, Invalid Input","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericErrorResponse"}}}}}},"description":"By grouping assets based on shared attributes, you can address them collectively. Asset groups enable more efficient bulk actions and simplifies both filtering and scoping within the inventory and across the platform.\n\nGet all or filtered asset groups.\n\n**Required license:** Cortex Cloud Runtime Security or Cortex Cloud Posture Management.","summary":"Get all or filtered asset groups"}}},"components":{"schemas":{"assetgroups_body":{"type":"object","properties":{"request_data":{"type":"object","properties":{"filters":{"oneOf":[{"$ref":"#/components/schemas/AndFilterForGroups"},{"$ref":"#/components/schemas/OrFilterForGroups"}]},"sort":{"$ref":"#/components/schemas/SortForGroups"},"search_from":{"type":"integer"},"search_to":{"type":"integer"}}}}},"AndFilterForGroups":{"required":["AND"],"type":"object","properties":{"AND":{"type":"array","items":{"$ref":"#/components/schemas/FilterConditionForGroups"}}}},"FilterConditionForGroups":{"type":"object","properties":{"SEARCH_FIELD":{"type":"string"},"SEARCH_TYPE":{"type":"string","enum":["EQ","NEQ","GT","LT","GTE","LTE","IN","NIN","RLIKE","NRLIKE","WILDCARD","WILDCARD_NOT","CONTAINS","NCONTAINS","IP_MATCH","NIP_MATCH","ARRAY_CONTAINS","ARRAY_NOT_CONTAINS","IS_EMPTY","NIS_EMPTY","REGEX","REGEX_NOT","REGEX_MATCH","REGEX_NOT_MATCH","IPLIST_MATCH","NLISTIP_MATCH","INCIDR","NINCIDR","INCIDR6","NINCIDR6","RANGE","RELATIVE_TIMESTAMP","JSON_OVERLAPS","JSON_ARRAY_CONTAINED_IN","JSON_IS_NOT_EMPTY"]},"SEARCH_VALUE":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"integer"}]}}},"OrFilterForGroups":{"required":["OR"],"type":"object","properties":{"AND":{"type":"array","items":{"$ref":"#/components/schemas/FilterConditionForGroups"}}}},"SortForGroups":{"type":"array","items":{"$ref":"#/components/schemas/SortObjectForGroups"}},"SortObjectForGroups":{"type":"object","properties":{"FIELD":{"type":"string"},"ORDER":{"type":"string","enum":["DESC","ASC"]}}},"GenericApiResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/GenericApiResponse_reply"}}},"GenericApiResponse_reply":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"metadata":{"$ref":"#/components/schemas/GenericApiResponse_reply_metadata"}}},"GenericApiResponse_reply_metadata":{"type":"object","properties":{"filter_count":{"type":"integer"},"total_count":{"type":"integer"}}},"UnauthorizedErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}},"GenericErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}}}}}
```

## Create an Asset Group

> Create a dynamic Asset Group by specifying the filters, or a static group to manually include individual assets.\
> \
> \*\*Required license:\*\* Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Asset groups","description":"APIs for managing asset groups"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/asset-groups/create":{"post":{"tags":["Asset groups"],"operationId":"post-public_api-v1-asset-groups-create","parameters":[{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/assetgroups_create_body"}}}},"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreateAssetGroupResponse"}}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UnauthorizedErrorResponse"}}}}},"500":{"description":"Internal Server Error, Invalid Input","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericErrorResponse"}}}}}},"description":"Create a dynamic Asset Group by specifying the filters, or a static group to manually include individual assets.\n\n**Required license:** Cortex Cloud Runtime Security or Cortex Cloud Posture Management.","summary":"Create an Asset Group"}}},"components":{"schemas":{"assetgroups_create_body":{"type":"object","properties":{"request_data":{"type":"object","properties":{"asset_group":{"$ref":"#/components/schemas/AssetGroup"}}}}},"AssetGroup":{"type":"object","properties":{"group_name":{"type":"string","description":"Asset Group name"},"group_type":{"type":"string","enum":["Dynamic","Static"],"description":"The type of Asset Group. Valid values include:\n- `Dynamic`: Assets grouped using filters. Any asset that meets the defined criteria is included.\n- `Static`: Manually add individual assets to be included in a group."},"group_description":{"type":"string","description":"Add an optional description to clarify the purpose of the Asset Group."},"membership_predicate":{"anyOf":[{"$ref":"#/components/schemas/AndFilter"},{"$ref":"#/components/schemas/OrFilter"}],"description":"Define the filter conditions for selecting which assets to be included in a dynamic Asset Group."}}},"AndFilter":{"required":["AND"],"type":"object","properties":{"AND":{"type":"array","items":{"$ref":"#/components/schemas/FilterCondition"}}}},"FilterCondition":{"type":"object","properties":{"SEARCH_FIELD":{"type":"string","description":"The field you want to filter."},"SEARCH_TYPE":{"type":"string","enum":["EQ","NEQ","GT","LT","GTE","LTE","IN","NIN","RLIKE","NRLIKE","WILDCARD","WILDCARD_NOT","CONTAINS","NCONTAINS","IP_MATCH","NIP_MATCH","ARRAY_CONTAINS","ARRAY_NOT_CONTAINS","IS_EMPTY","NIS_EMPTY","REGEX","REGEX_NOT","REGEX_MATCH","REGEX_NOT_MATCH","IPLIST_MATCH","NLISTIP_MATCH","INCIDR","NINCIDR","INCIDR6","NINCIDR6","RANGE","RELATIVE_TIMESTAMP","JSON_OVERLAPS","JSON_ARRAY_CONTAINED_IN","JSON_IS_NOT_EMPTY"],"description":"The operator to apply to the `SEARCH_FIELD`. It defines how the `SEARCH_VALUE` will be used to evaluate the `SEARCH_FIELD`."},"SEARCH_VALUE":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"integer"},{"type":"object"}],"description":"The value that the `SEARCH_FIELD` will be compared to, based on the `SEARCH_TYPE` operator.\nValid values include: EQ`, `IN`, `NIN`, `NEQ`, `IS`, `IS_NOT`, `LIKE_ANY`, `NOT_LIKE_ANY`, `WILDCARD`, `WILDCARD_NOT`, `REGEX`, `REGEX_NOT`, `GT`, `LT`, `GTE`, `LTE`, `RELATIVE_TIMESTAMP`, `RANGE`, `CONTAINS`, `JSON_SEARCH`, `JSON_OVERLAPS`, `JSON_OVERLAPS_NOT`, `NCONTAINS`, `CONTAINS_IN_LIST`, `NOT_CONTAINS_IN_LIST`, `ARRAY_LEN_EQ`, `ARRAY_LEN_NEQ`, `ARRAY_CONTAINS`, `ARRAY_CONTAINS_NUMBERS`, `ARRAY_NOT_CONTAINS`, `JSON_EQ`, `JSON_NEQ`, `JSON_WILDCARD_NOT`, `JSON_WILDCARD`, `JSON_GTE`, `JSON_LTE`, `JSON_GT`, `JSON_LT`, `JSON_CONTAINS_NOT`, `JSON_CONTAINS`, `JSON_ARRAY_CONTAINED_IN`, `JSON_ARRAY_NOT_CONTAINED_IN`, `JSON_ARRAY_CONTAINS`, `JSON_ARRAY_CONTAINS_NOT`, `JSON_IS_EMPTY`, `JSON_IS_NOT_EMPTY`"}}},"OrFilter":{"required":["OR"],"type":"object","properties":{"OR":{"type":"array","items":{"$ref":"#/components/schemas/FilterCondition"}}}},"CreateAssetGroupResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/CreateAssetGroupResponse_reply"}}},"CreateAssetGroupResponse_reply":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateAssetGroupResponse_reply_data"}}},"CreateAssetGroupResponse_reply_data":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the Asset Group creation was successful"},"asset_group_id":{"type":"integer","description":"ID of the new Asset Group"}}},"UnauthorizedErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}},"GenericErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}}}}}
```

## Update an Asset Group

> Update the Asset Group specified by Asset Group ID.\
> \
> \*\*Required license:\*\* Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Asset groups","description":"APIs for managing asset groups"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/asset-groups/update/{group_id}":{"post":{"tags":["Asset groups"],"operationId":"post-public_api-v1-asset-groups-update-by-id","parameters":[{"name":"group_id","in":"path","description":"Asset Group ID","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/update_group_id_body"}}}},"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericAssetGroupsResponse"}}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UnauthorizedErrorResponse"}}}}},"500":{"description":"Internal Server Error, Invalid Input","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericErrorResponse"}}}}}},"description":"Update the Asset Group specified by Asset Group ID.\n\n**Required license:** Cortex Cloud Runtime Security or Cortex Cloud Posture Management.","summary":"Update an Asset Group"}}},"components":{"schemas":{"update_group_id_body":{"type":"object","properties":{"request_data":{"type":"object","properties":{"asset_group":{"$ref":"#/components/schemas/AssetGroup"}}}}},"AssetGroup":{"type":"object","properties":{"group_name":{"type":"string","description":"Asset Group name"},"group_type":{"type":"string","enum":["Dynamic","Static"],"description":"The type of Asset Group. Valid values include:\n- `Dynamic`: Assets grouped using filters. Any asset that meets the defined criteria is included.\n- `Static`: Manually add individual assets to be included in a group."},"group_description":{"type":"string","description":"Add an optional description to clarify the purpose of the Asset Group."},"membership_predicate":{"anyOf":[{"$ref":"#/components/schemas/AndFilter"},{"$ref":"#/components/schemas/OrFilter"}],"description":"Define the filter conditions for selecting which assets to be included in a dynamic Asset Group."}}},"AndFilter":{"required":["AND"],"type":"object","properties":{"AND":{"type":"array","items":{"$ref":"#/components/schemas/FilterCondition"}}}},"FilterCondition":{"type":"object","properties":{"SEARCH_FIELD":{"type":"string","description":"The field you want to filter."},"SEARCH_TYPE":{"type":"string","enum":["EQ","NEQ","GT","LT","GTE","LTE","IN","NIN","RLIKE","NRLIKE","WILDCARD","WILDCARD_NOT","CONTAINS","NCONTAINS","IP_MATCH","NIP_MATCH","ARRAY_CONTAINS","ARRAY_NOT_CONTAINS","IS_EMPTY","NIS_EMPTY","REGEX","REGEX_NOT","REGEX_MATCH","REGEX_NOT_MATCH","IPLIST_MATCH","NLISTIP_MATCH","INCIDR","NINCIDR","INCIDR6","NINCIDR6","RANGE","RELATIVE_TIMESTAMP","JSON_OVERLAPS","JSON_ARRAY_CONTAINED_IN","JSON_IS_NOT_EMPTY"],"description":"The operator to apply to the `SEARCH_FIELD`. It defines how the `SEARCH_VALUE` will be used to evaluate the `SEARCH_FIELD`."},"SEARCH_VALUE":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"integer"},{"type":"object"}],"description":"The value that the `SEARCH_FIELD` will be compared to, based on the `SEARCH_TYPE` operator.\nValid values include: EQ`, `IN`, `NIN`, `NEQ`, `IS`, `IS_NOT`, `LIKE_ANY`, `NOT_LIKE_ANY`, `WILDCARD`, `WILDCARD_NOT`, `REGEX`, `REGEX_NOT`, `GT`, `LT`, `GTE`, `LTE`, `RELATIVE_TIMESTAMP`, `RANGE`, `CONTAINS`, `JSON_SEARCH`, `JSON_OVERLAPS`, `JSON_OVERLAPS_NOT`, `NCONTAINS`, `CONTAINS_IN_LIST`, `NOT_CONTAINS_IN_LIST`, `ARRAY_LEN_EQ`, `ARRAY_LEN_NEQ`, `ARRAY_CONTAINS`, `ARRAY_CONTAINS_NUMBERS`, `ARRAY_NOT_CONTAINS`, `JSON_EQ`, `JSON_NEQ`, `JSON_WILDCARD_NOT`, `JSON_WILDCARD`, `JSON_GTE`, `JSON_LTE`, `JSON_GT`, `JSON_LT`, `JSON_CONTAINS_NOT`, `JSON_CONTAINS`, `JSON_ARRAY_CONTAINED_IN`, `JSON_ARRAY_NOT_CONTAINED_IN`, `JSON_ARRAY_CONTAINS`, `JSON_ARRAY_CONTAINS_NOT`, `JSON_IS_EMPTY`, `JSON_IS_NOT_EMPTY`"}}},"OrFilter":{"required":["OR"],"type":"object","properties":{"OR":{"type":"array","items":{"$ref":"#/components/schemas/FilterCondition"}}}},"GenericAssetGroupsResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/GenericAssetGroupsResponse_reply"}}},"GenericAssetGroupsResponse_reply":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GenericAssetGroupsResponse_reply_data"}}},"GenericAssetGroupsResponse_reply_data":{"type":"object","properties":{"success":{"type":"boolean"}}},"UnauthorizedErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}},"GenericErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}}}}}
```

## Delete an Asset Group

> Delete the Asset Group specified by Asset Group ID.\
> \
> \*\*Required license:\*\* Cortex Cloud Runtime Security or Cortex Cloud Posture Management.

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Asset groups","description":"APIs for managing asset groups"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/asset-groups/delete/{group_id}":{"post":{"tags":["Asset groups"],"operationId":"post-public_api-v1-asset-groups-delete-by-id","parameters":[{"name":"group_id","in":"path","description":"Asset Group ID","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericAssetGroupsResponse"}}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UnauthorizedErrorResponse"}}}}},"500":{"description":"Internal Server Error, Invalid Input","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GenericErrorResponse"}}}}}},"description":"Delete the Asset Group specified by Asset Group ID.\n\n**Required license:** Cortex Cloud Runtime Security or Cortex Cloud Posture Management.","summary":"Delete an Asset Group"}}},"components":{"schemas":{"GenericAssetGroupsResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/GenericAssetGroupsResponse_reply"}}},"GenericAssetGroupsResponse_reply":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GenericAssetGroupsResponse_reply_data"}}},"GenericAssetGroupsResponse_reply_data":{"type":"object","properties":{"success":{"type":"boolean"}}},"UnauthorizedErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}},"GenericErrorResponse":{"type":"object","properties":{"err_code":{"type":"integer"},"err_msg":{"type":"string"},"err_extra":{"type":"string"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-cloud-api/cortex-platform/asset-groups.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
