> 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/xdr-5-api/identity-and-access-management-iam/scopes.md).

# Scopes

Operations for managing Scope-Based Access Control (SBAC) configurations for users, groups, and API keys.

## Retrieve an existing scope

> This API endpoint allows retrieving the scope details for a specific entity type and entity ID. For possible 'mode' and 'entity\_type' values, please refer to the enum documentation for 'ModeType' and 'EntityType'.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Platform IAM APIs","version":"Cortex XDR 5.1"},"tags":[{"name":"Scopes","description":"Operations for managing Scope-Based Access Control (SBAC) configurations for users, groups, and API keys."}],"servers":[{"url":"https://api-{fqdn}","variables":{"fqdn":{"default":"cortex.paloaltonetworks.com","description":"The Fully Qualified Domain Name for the Cortex instance"}}}],"paths":{"/platform/iam/v1/scope/{entity_type}/{entity_id}":{"get":{"tags":["Scopes"],"summary":"Retrieve an existing scope","description":"This API endpoint allows retrieving the scope details for a specific entity type and entity ID. For possible 'mode' and 'entity_type' values, please refer to the enum documentation for 'ModeType' and 'EntityType'.","operationId":"getScope","parameters":[{"name":"entity_type","in":"path","description":"Full name of the entity's type","required":true,"schema":{"$ref":"#/components/schemas/EntityType"}},{"name":"entity_id","in":"path","description":"Full id of the entity","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved scope","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/UnauthorizedImproperPermissions"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"schemas":{"EntityType":{"type":"string","description":"The type of entity - Possible values: user (Signifies that the entity is a user), usergroup (Signifies that the entity is a custom or AD user group), apikey (Signifies that the entity is an API key)","enum":["user","user-group","api-key"]},"Metadata":{"type":"object","description":"Metadata for the response","additionalProperties":true}},"responses":{"Unauthorized":{"description":"Unauthorized access","content":{"application/json":{"schema":{"type":"object"}}}},"UnauthorizedImproperPermissions":{"description":"Unauthorized access due to lack of sufficient permissions. This includes Instance Administrator privilege escalation errors: non-admin API keys cannot assign, modify, or delete entities that have the Instance Administrator role.","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","properties":{"err_msg":{"type":"string"},"err_extra":{"type":"string"},"err_code":{"type":"integer"},"metadata":{"type":"object"}},"required":["err_msg","metadata"]}},"required":["reply"]}}}},"InternalError":{"description":"Internal server error. A unified status for API communication type errors."}}}}
```

## Edit an existing scope

> This API endpoint allows editing the scope details for a specific entity type and entity ID. For possible 'mode' and 'entity\_type' values, please refer to the enum documentation for 'ModeType' and 'EntityType'. Please note that the 'datasets\_rows' field can only be passed in to the request body if the dataset scope configuration is enabled for the tenant. Dataset row-level scoping is available only on XSIAM tenants where the feature has been activated — it is not configurable through the UI or a public API. Contact your Palo Alto Networks account team to enable this feature. When dataset scope is enabled, the 'datasets\_rows' field becomes mandatory in every scope edit request; omitting it returns a 400 error.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Platform IAM APIs","version":"Cortex XDR 5.1"},"tags":[{"name":"Scopes","description":"Operations for managing Scope-Based Access Control (SBAC) configurations for users, groups, and API keys."}],"servers":[{"url":"https://api-{fqdn}","variables":{"fqdn":{"default":"cortex.paloaltonetworks.com","description":"The Fully Qualified Domain Name for the Cortex instance"}}}],"paths":{"/platform/iam/v1/scope/{entity_type}/{entity_id}":{"put":{"tags":["Scopes"],"summary":"Edit an existing scope","operationId":"editScope","description":"This API endpoint allows editing the scope details for a specific entity type and entity ID. For possible 'mode' and 'entity_type' values, please refer to the enum documentation for 'ModeType' and 'EntityType'. Please note that the 'datasets_rows' field can only be passed in to the request body if the dataset scope configuration is enabled for the tenant. Dataset row-level scoping is available only on XSIAM tenants where the feature has been activated — it is not configurable through the UI or a public API. Contact your Palo Alto Networks account team to enable this feature. When dataset scope is enabled, the 'datasets_rows' field becomes mandatory in every scope edit request; omitting it returns a 400 error.","parameters":[{"name":"entity_type","in":"path","description":"Full name of the entity's type","required":true,"schema":{"$ref":"#/components/schemas/EntityType"}},{"name":"entity_id","in":"path","description":"Full id of the entity","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The scope configuration updates for the specified entity","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopeEditRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/ScopeEditedSuccess"},"400":{"$ref":"#/components/responses/ScopeEditedBadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/UnauthorizedImproperPermissions"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"schemas":{"EntityType":{"type":"string","description":"The type of entity - Possible values: user (Signifies that the entity is a user), usergroup (Signifies that the entity is a custom or AD user group), apikey (Signifies that the entity is an API key)","enum":["user","user-group","api-key"]},"ScopeEditRequest":{"type":"object","required":["request_data"],"properties":{"request_data":{"type":"object","description":"Scope configuration data to update","properties":{"assets":{"$ref":"#/components/schemas/AssetsScopeRequest"},"datasets_rows":{"$ref":"#/components/schemas/DatasetsRowsScope"},"endpoints":{"$ref":"#/components/schemas/EndpointsScopeRequest"},"cases_issues":{"$ref":"#/components/schemas/CasesIssuesScopeRequest"}}}},"additionalProperties":false},"AssetsScopeRequest":{"type":"object","description":"Asset scope configuration for request payloads","properties":{"mode":{"type":"string","description":"Access mode for assets. Use 'scope' to limit access to specific asset groups, 'see_all' for full access, or 'no_scope' for no access","enum":["no_scope","see_all","scope"]},"asset_group_ids":{"type":"array","description":"List of asset group IDs when configuring scope (used in PUT requests)","items":{"type":"integer"}}}},"DatasetsRowsScope":{"type":"object","description":"Dataset rows scope configuration for row-level data access filtering. Only available on XSIAM tenants with the dataset scope feature enabled. When the feature is enabled, this field is mandatory in scope edit requests.","properties":{"default_filter_mode":{"type":"string","description":"Default behavior for datasets not explicitly listed in filters. 'no_scope' means no access to unlisted datasets, 'see_all' means full access to unlisted datasets","enum":["no_scope","see_all"]},"filters":{"type":"array","description":"List of dataset-specific filters to apply row-level access control","items":{"$ref":"#/components/schemas/DatasetFilter"}}}},"DatasetFilter":{"type":"object","description":"Row-level filter for a specific dataset","required":["dataset","filter"],"properties":{"dataset":{"type":"string","description":"Name of the dataset to apply the filter to"},"filter":{"type":"string","description":"Filter expression to limit data access (e.g., '_collector_name = collector_1')"}}},"EndpointsScopeRequest":{"type":"object","description":"Endpoint scope configuration for request payloads","properties":{"endpoint_groups":{"$ref":"#/components/schemas/EndpointGroupsScopeRequest"},"endpoint_tags":{"$ref":"#/components/schemas/EndpointTagsScopeRequest"}}},"EndpointGroupsScopeRequest":{"type":"object","description":"Endpoint groups scope configuration for requests","properties":{"mode":{"type":"string","description":"Access mode for endpoint groups","enum":["no_scope","see_all","scope","any"]},"names":{"type":"array","description":"List of endpoint group names when configuring scope","items":{"type":"string"}}}},"EndpointTagsScopeRequest":{"type":"object","description":"Endpoint tags scope configuration for requests","properties":{"mode":{"type":"string","description":"Access mode for endpoint tags","enum":["no_scope","see_all","scope","any"]},"names":{"type":"array","description":"List of endpoint tag names when configuring scope","items":{"type":"string"}}}},"CasesIssuesScopeRequest":{"type":"object","description":"Cases and issues scope configuration for requests","properties":{"mode":{"type":"string","description":"Access mode for cases and issues","enum":["no_scope","see_all","scope"]},"include_cases_issues_empty_entities":{"type":"boolean","description":"Whether to include cases and issues that have no associated entities/tags"},"names":{"type":"array","description":"List of tag names when configuring scope","items":{"type":"string"}}}}},"responses":{"ScopeEditedSuccess":{"description":"Scope edited successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string","description":"Success message indicating the scope was edited"}},"required":["message"]}},"required":["data"]}}}},"ScopeEditedBadRequest":{"description":"Bad request for scope edit call","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"err_msg":{"type":"string","description":"Error message describing the issue"},"metadata":{"type":"object","properties":{"err_extra":{"type":"string","description":"Additional error details"},"err_code":{"type":"integer","description":"HTTP error code"}},"required":["err_extra","err_code"]}},"required":["err_msg","metadata"]}},"required":["data"]}}}},"Unauthorized":{"description":"Unauthorized access","content":{"application/json":{"schema":{"type":"object"}}}},"UnauthorizedImproperPermissions":{"description":"Unauthorized access due to lack of sufficient permissions. This includes Instance Administrator privilege escalation errors: non-admin API keys cannot assign, modify, or delete entities that have the Instance Administrator role.","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","properties":{"err_msg":{"type":"string"},"err_extra":{"type":"string"},"err_code":{"type":"integer"},"metadata":{"type":"object"}},"required":["err_msg","metadata"]}},"required":["reply"]}}}},"InternalError":{"description":"Internal server error. A unified status for API communication type errors."}}}}
```


---

# 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/xdr-5-api/identity-and-access-management-iam/scopes.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.
