> For the complete documentation index, see [llms.txt](https://docs.reviactyl.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reviactyl.app/application-api/user.md).

# User

## GET /users

> Handle request to list all users on the panel. Returns a JSON-API representation\
> of a collection of users including any defined relations passed in\
> the request

```json
{"openapi":"3.1.0","info":{"title":"Reviactyl","version":"0.0.1"},"servers":[{"url":"https://reviactyl.test/api/application"}],"paths":{"/users":{"get":{"operationId":"application.users","summary":"Handle request to list all users on the panel. Returns a JSON-API representation\nof a collection of users including any defined relations passed in\nthe request","tags":["User"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{}}}}},"403":{"$ref":"#/components/responses/AuthorizationException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}},"components":{"responses":{"AuthorizationException":{"description":"Authorization error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}}}
```

## POST /users

> Store a new user on the system. Returns the created user and an HTTP/201\
> header on successful creation

```json
{"openapi":"3.1.0","info":{"title":"Reviactyl","version":"0.0.1"},"servers":[{"url":"https://reviactyl.test/api/application"}],"paths":{"/users":{"post":{"operationId":"user.store","summary":"Store a new user on the system. Returns the created user and an HTTP/201\nheader on successful creation","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreUserRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/AuthorizationException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}},"components":{"schemas":{"StoreUserRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":1,"maxLength":191},"external_id":{"type":["string","null"],"maxLength":191},"username":{"type":"string","minLength":1,"maxLength":191},"password":{"type":["string","null"]},"root_admin":{"type":"boolean"},"language":{"type":"string","enum":["ar","bn","de","en","es","fr","hi","id","kn","pt","ru","sv","tr","vi","zh","geo"]},"first_name":{"type":"string","minLength":1,"maxLength":191},"last_name":{"type":"string","minLength":1,"maxLength":191}},"required":["email","username","first_name","last_name"],"title":"StoreUserRequest"}},"responses":{"AuthorizationException":{"description":"Authorization error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}}}
```

## GET /users/{user}

> Handle a request to view a single user. Includes any relations that\
> were defined in the request

```json
{"openapi":"3.1.0","info":{"title":"Reviactyl","version":"0.0.1"},"servers":[{"url":"https://reviactyl.test/api/application"}],"paths":{"/users/{user}":{"get":{"operationId":"application.users.view","summary":"Handle a request to view a single user. Includes any relations that\nwere defined in the request","tags":["User"],"parameters":[{"name":"user","in":"path","required":true,"description":"The user ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{}}}}},"403":{"$ref":"#/components/responses/AuthorizationException"},"404":{"$ref":"#/components/responses/ModelNotFoundException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}},"components":{"responses":{"AuthorizationException":{"description":"Authorization error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ModelNotFoundException":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}}}
```

## DELETE /users/{user}

> Handle a request to delete a user from the Panel. Returns a HTTP/204 response\
> on successful deletion

```json
{"openapi":"3.1.0","info":{"title":"Reviactyl","version":"0.0.1"},"servers":[{"url":"https://reviactyl.test/api/application"}],"paths":{"/users/{user}":{"delete":{"operationId":"user.delete","summary":"Handle a request to delete a user from the Panel. Returns a HTTP/204 response\non successful deletion","tags":["User"],"parameters":[{"name":"user","in":"path","required":true,"description":"The user ID","schema":{"type":"integer"}}],"responses":{"204":{"description":"No content","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0}}}},"403":{"$ref":"#/components/responses/AuthorizationException"},"404":{"$ref":"#/components/responses/ModelNotFoundException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}},"components":{"responses":{"AuthorizationException":{"description":"Authorization error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ModelNotFoundException":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}}}
```

Update an existing user on the system and return the response. Returns the\
updated user model response on success. Supports handling of token revocation\
errors when switching a user from an admin to a normal user
-----------------------------------------------------------

> Revocation errors are returned under the 'revocation\_errors' key in the response\
> meta. If there are no errors this is an empty array.

```json
{"openapi":"3.1.0","info":{"title":"Reviactyl","version":"0.0.1"},"servers":[{"url":"https://reviactyl.test/api/application"}],"paths":{"/users/{user}":{"patch":{"operationId":"user.update","description":"Revocation errors are returned under the 'revocation_errors' key in the response\nmeta. If there are no errors this is an empty array.","summary":"Update an existing user on the system and return the response. Returns the\nupdated user model response on success. Supports handling of token revocation\nerrors when switching a user from an admin to a normal user","tags":["User"],"parameters":[{"name":"user","in":"path","required":true,"description":"The user ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{}}}}},"403":{"$ref":"#/components/responses/AuthorizationException"},"404":{"$ref":"#/components/responses/ModelNotFoundException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}},"components":{"responses":{"AuthorizationException":{"description":"Authorization error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ModelNotFoundException":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.reviactyl.app/application-api/user.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
