> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/users.md).

# Users

## Get a list of users

> Returns all users for the organization.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetUsersResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUsersResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetUsersResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/User"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"User":{"properties":{"avatar_url":{"description":"The avatar URL of the user.","type":"string"},"email":{"description":"The primary email of the user.","type":"string"},"emails":{"description":"The list of all emails of the user.","items":{"type":"string"},"type":"array"},"id":{"description":"The ID of the user.","type":"string"},"is_deactivated":{"description":"Whether the user is deactivated.","type":"boolean"},"name":{"description":"The name of the user.","type":"string"},"role":{"$ref":"#/components/schemas/MiniRole"},"role_id":{"description":"The role_id of the user.","type":"string"},"status":{"description":"The status of the user.","enum":["","active","away","out_of_office"],"type":"string"}},"type":"object"},"MiniRole":{"properties":{"id":{"description":"The ID of the role.","type":"string"},"name":{"description":"The name of the role.","type":"string"},"slug":{"description":"The slug of the role.","type":"string"}},"type":"object"},"Pagination":{"properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/users":{"get":{"description":"Returns all users for the organization.\n\n**Rate limit:** 300 requests per minute","operationId":"GetUsers","parameters":[{"description":"Whether to include deactivated users. Defaults to false.","in":"query","name":"include_deactivated","schema":{"type":"boolean"}}],"responses":{"200":{"$ref":"#/components/responses/GetUsersResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get a list of users","tags":["users"]}}}}
```

## Get a user by its ID

> Returns a single user by ID.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetUserResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetUserResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/User"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"User":{"properties":{"avatar_url":{"description":"The avatar URL of the user.","type":"string"},"email":{"description":"The primary email of the user.","type":"string"},"emails":{"description":"The list of all emails of the user.","items":{"type":"string"},"type":"array"},"id":{"description":"The ID of the user.","type":"string"},"is_deactivated":{"description":"Whether the user is deactivated.","type":"boolean"},"name":{"description":"The name of the user.","type":"string"},"role":{"$ref":"#/components/schemas/MiniRole"},"role_id":{"description":"The role_id of the user.","type":"string"},"status":{"description":"The status of the user.","enum":["","active","away","out_of_office"],"type":"string"}},"type":"object"},"MiniRole":{"properties":{"id":{"description":"The ID of the role.","type":"string"},"name":{"description":"The name of the role.","type":"string"},"slug":{"description":"The slug of the role.","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/users/{id}":{"get":{"description":"Returns a single user by ID.\n\n**Rate limit:** 300 requests per minute","operationId":"GetUser","parameters":[{"description":"The ID of the user to fetch.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/GetUserResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get a user by its ID","tags":["user"]}}}}
```

## Update a user

> Updates an existing user. Only provided fields are modified.\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"UpdateUserRequestBody":{"properties":{"avatar_url":{"description":"The avatar URL of the user. Must be a square .png, .jpg or .jpeg.","type":"string"},"name":{"description":"The name of the user.","type":"string"},"role_id":{"description":"The role_id of the user.","type":"string"},"status":{"description":"The new user status for the user. Can be one of `active`, `away`, or `out_of_office`.","enum":["active","away","out_of_office"],"type":"string"}},"type":"object"},"GetUserResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/User"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"User":{"properties":{"avatar_url":{"description":"The avatar URL of the user.","type":"string"},"email":{"description":"The primary email of the user.","type":"string"},"emails":{"description":"The list of all emails of the user.","items":{"type":"string"},"type":"array"},"id":{"description":"The ID of the user.","type":"string"},"is_deactivated":{"description":"Whether the user is deactivated.","type":"boolean"},"name":{"description":"The name of the user.","type":"string"},"role":{"$ref":"#/components/schemas/MiniRole"},"role_id":{"description":"The role_id of the user.","type":"string"},"status":{"description":"The status of the user.","enum":["","active","away","out_of_office"],"type":"string"}},"type":"object"},"MiniRole":{"properties":{"id":{"description":"The ID of the role.","type":"string"},"name":{"description":"The name of the role.","type":"string"},"slug":{"description":"The slug of the role.","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}},"responses":{"GetUserResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/users/{id}":{"patch":{"description":"Updates an existing user. Only provided fields are modified.\n\n**Rate limit:** 120 requests per minute","operationId":"UpdateUser","parameters":[{"description":"The ID of the user to update.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequestBody"}}}},"responses":{"200":{"$ref":"#/components/responses/GetUserResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Update a user","tags":["user"]}}}}
```

## Search for users by a given filter

> Filterable fields and their allowed operators:\
> \
> &#x20;Field | Allowed operators |\
> &#x20;\--- | --- |\
> &#x20;\`email\` | \`equals\`, \`in\`, \`not\_in\` |\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"SearchUsersRequest":{"properties":{"cursor":{"description":"The cursor to use for pagination.","type":"string"},"filter":{"$ref":"#/components/schemas/Filter"},"limit":{"description":"The number of users to fetch. Defaults to 100. Must be greater than 0 and less than 1000.","format":"int64","type":"integer"}},"type":"object"},"Filter":{"properties":{"field":{"description":"The field for this filter.  For allowed fields, see the documentation for\nthe specific endpoint you are using.\nFor non-compound filters (any operators other than \"and\" or \"or\"),\nfield must be set, along with either value or values, depending on the operator.","type":"string"},"operator":{"description":"The operator for this filter.","enum":["equals","not_equals","contains","does_not_contain","in","not_in","and","or","time_is_after","time_is_before","time_range","string_contains","string_does_not_contain","is_set","is_unset","greater_than","less_than","greater_than_or_equals","less_than_or_equals"],"type":"string"},"subfilters":{"description":"Sub-filters for this filter.  Valid only when operator is \"and\" or \"or\".\nThe maximum allowed depth for a tree of filters is 3.","items":{"$ref":"#/components/schemas/Filter"},"type":"array"},"value":{"description":"The value for this filter. Only used for single-valued operators\n(\"equals\", \"not_equals\", \"contains\", \"does_not_contain\")","type":"string"},"values":{"description":"The values for this filter. Only used for multi-valued operators (\"in\", \"not_in\").","items":{"type":"string"},"type":"array"}},"required":["operator"],"type":"object"},"SearchUsersResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/User"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"User":{"properties":{"avatar_url":{"description":"The avatar URL of the user.","type":"string"},"email":{"description":"The primary email of the user.","type":"string"},"emails":{"description":"The list of all emails of the user.","items":{"type":"string"},"type":"array"},"id":{"description":"The ID of the user.","type":"string"},"is_deactivated":{"description":"Whether the user is deactivated.","type":"boolean"},"name":{"description":"The name of the user.","type":"string"},"role":{"$ref":"#/components/schemas/MiniRole"},"role_id":{"description":"The role_id of the user.","type":"string"},"status":{"description":"The status of the user.","enum":["","active","away","out_of_office"],"type":"string"}},"type":"object"},"MiniRole":{"properties":{"id":{"description":"The ID of the role.","type":"string"},"name":{"description":"The name of the role.","type":"string"},"slug":{"description":"The slug of the role.","type":"string"}},"type":"object"},"Pagination":{"properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}},"responses":{"SearchUsersResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchUsersResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/users/search":{"post":{"description":"Filterable fields and their allowed operators:\n\n Field | Allowed operators |\n --- | --- |\n `email` | `equals`, `in`, `not_in` |\n\n**Rate limit:** 120 requests per minute","operationId":"SearchUsers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchUsersRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchUsersResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Search for users by a given filter","tags":["users"]}}}}
```


---

# 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://docs.usepylon.com/pylon-docs/developer/api/api-reference/users.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.
