> 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/agentix-api/cortex-platform-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 AgentiX"},"tags":[{"name":"Scopes","description":"Operations for managing Scope-Based Access Control (SBAC) configurations for users, groups, and API keys."}],"servers":[{"url":"https://api-{{fqdn}}"}],"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":{"metadata":{"$ref":"#/components/schemas/Metadata"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/UnauthorizedImproperPermissions"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"schemas":{"EntityType":{"type":"string","enum":["user","user-group","api-key"],"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)"},"Metadata":{"type":"object","description":"Metadata for the response"}},"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"}},"required":["err_msg"]}}}}}},"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 AgentiX"},"tags":[{"name":"Scopes","description":"Operations for managing Scope-Based Access Control (SBAC) configurations for users, groups, and API keys."}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/platform/iam/v1/scope/{entity_type}/{entity_id}":{"put":{"tags":["Scopes"],"summary":"Edit an existing scope","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.","operationId":"editScope","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":{"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","enum":["user","user-group","api-key"],"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)"},"ScopeEditRequest":{"type":"object","additionalProperties":false,"properties":{"request_data":{"type":"object","properties":{"tags_scope":{"type":"object","nullable":true,"description":"Definition of tags scope configuration"},"tagless_scope":{"type":"object","nullable":true,"description":"Definition of tagless scope configuration"}}}},"required":["request_data"]}},"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"}},"required":["err_msg"]}}}}}},"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/agentix-api/cortex-platform-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.
