> 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/user.md).

# User

Operations for managing users including listing users and editing user configurations.

## List all users

> This endpoint retrieves a list of all users and their respective properties.  Note: the 'role\_name' field refers to the 'pretty\_name' attribute from the Roles APIs and the direct role assigned to the user, not roles inherited through groups.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Platform IAM APIs","version":"Cortex AgentiX"},"tags":[{"name":"User","description":"Operations for managing users including listing users and editing user configurations."}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/platform/iam/v1/user":{"get":{"tags":["User"],"summary":"List all users","description":"This endpoint retrieves a list of all users and their respective properties.  Note: the 'role_name' field refers to the 'pretty_name' attribute from the Roles APIs and the direct role assigned to the user, not roles inherited through groups.","operationId":"listUsers","responses":{"200":{"description":"Successfully retrieved users","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":{"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."}}}}
```

## Get user

> This endpoint retrieves a user and its respective properties. Note: the 'role\_name' field refers to the 'pretty\_name' attribute from the Roles APIs, not the unique role identifier.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Platform IAM APIs","version":"Cortex AgentiX"},"tags":[{"name":"User","description":"Operations for managing users including listing users and editing user configurations."}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/platform/iam/v1/user/{user_email}":{"get":{"tags":["User"],"summary":"Get user","description":"This endpoint retrieves a user and its respective properties. Note: the 'role_name' field refers to the 'pretty_name' attribute from the Roles APIs, not the unique role identifier.","operationId":"getUserByEmail","parameters":[{"name":"user_email","in":"path","description":"Full email of the user","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved user","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":{"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 user

> This endpoint allows updating various user details. Please note that you must pass an empty string for the 'role\_id' field if you are attempting to remove a role from a user. For the 'user\_groups' field, please pass an empty list to remove user group associations for the provided user.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Platform IAM APIs","version":"Cortex AgentiX"},"tags":[{"name":"User","description":"Operations for managing users including listing users and editing user configurations."}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/platform/iam/v1/user/{user_email}":{"patch":{"tags":["User"],"summary":"Edit an existing user","description":"This endpoint allows updating various user details. Please note that you must pass an empty string for the 'role_id' field if you are attempting to remove a role from a user. For the 'user_groups' field, please pass an empty list to remove user group associations for the provided user.","operationId":"editUser","parameters":[{"name":"user_email","in":"path","description":"Full email of the user","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEditRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/UserEditedSuccess"},"400":{"$ref":"#/components/responses/UserEditedBadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/UnauthorizedImproperPermissions"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"schemas":{"UserEditRequest":{"type":"object","additionalProperties":false,"properties":{"request_data":{"type":"object","properties":{"user_first_name":{"type":"string","nullable":true,"description":"User's first name"},"user_last_name":{"type":"string","nullable":true,"description":"User's last name"},"role_id":{"type":"string","nullable":true,"description":"User's assigned role. Note: this refers to the 'role_id' attribute from the Role APIs (the unique role identifier)"},"phone_number":{"type":"string","nullable":true,"description":"User's phone number"},"status":{"type":"string","nullable":true,"description":"User's status"},"is_hidden":{"type":"boolean","nullable":true,"description":"User's hidden status"},"user_groups":{"type":"array","nullable":true,"description":"User's assigned groups","items":{"type":"string"}}}}},"required":["request_data"]}},"responses":{"UserEditedSuccess":{"description":"User edited successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string","description":"Success message indicating the user was edited"}},"required":["message"]}},"required":["data"]}}}},"UserEditedBadRequest":{"description":"Bad request for user 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/user.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.
