---
title: "Search for users by a given filter"
method: POST
path: "/users/search"
tags: ["users"]
---

# Search for users by a given filter

`POST /users/search`

Filterable fields and their allowed operators:

 Field | Allowed operators |
 --- | --- |
 `email` | `equals`, `in`, `not_in` |

**Rate limit:** 20 requests per minute

## Request body

- SearchUsersRequest
  - `cursor` string — The cursor to use for pagination.
  - `filter` Filter
    - `field` string, required — The field for this filter. For allowed fields, see the documentation for the specific endpoint you are using. For non-compound filters (any operators other than "and" or "or"), Field must be set, along with either Value or Values, depending on the operator.
    - `operator` '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', required — The operator for this filter.
    - `subfilters` Filter[] — Sub-filters for this filter. Valid only when operator is "and" or "or". The maximum allowed depth for a tree of filters is 3.
    - `value` string — The value for this filter. Only used for single-valued operators ("equals", "not_equals", "contains", "does_not_contain")
    - `values` string[] — The values for this filter. Only used for multi-valued operators ("in", "not_in").
  - `limit` integer — The number of users to fetch. Defaults to 100. Must be greater than 0 and less than 1000.

## Response `200`

- SearchUsersResponseBody
  - `data` User[] — The data payload of the response.
    - `avatar_url` string — The avatar URL of the user.
    - `email` string — The primary email of the user.
    - `emails` string[] — The list of all emails of the user.
    - `id` string — The ID of the user.
    - `is_deactivated` boolean — Whether the user is deactivated.
    - `name` string — The name of the user.
    - `role` MiniRole
      - `id` string — The ID of the role.
      - `name` string — The name of the role.
      - `slug` string — The slug of the role.
    - `role_id` string — The role_id of the user.
    - `status` '' | 'active' | 'away' | 'out_of_office' — The status of the user.
  - `pagination` Pagination
    - `cursor` string, required — The cursor for the next page of results.
    - `has_next_page` boolean, required — Indicates if there is a next page of results.
  - `request_id` string — The request ID for tracking.

## Other responses

- `400` — The request was invalid or could not be completed.
- `404`
- `500` — An unexpected internal error occurred.

---

[API](https://skmtc.net/usepylon/apis/pylon-api.md) · [All operations](https://skmtc.net/usepylon/apis/pylon-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usepylon/pylon-api/revisions/ad855d921ee9/schema)
