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

# Search for accounts by a given filter

`POST /accounts/search`

Optionally pass `search_text` for fuzzy matching. Results are intersected with any provided filter.

Filterable fields and their allowed operators:

 Field | Allowed operators |
 --- | --- |
 `id` | `equals`, `in`, `not_in` |
 `domains` | `contains`, `does_not_contain`, `in`, `not_in` |
 `tags` | `contains`, `does_not_contain`, `in`, `not_in` |
 `name` | `equals`, `in`, `not_in`, `string_contains` |
 `external_ids` | `equals`, `in`, `not_in`, `is_set`, `is_unset` |
 `owner_id` | `equals`, `in`, `not_in`, `is_set`, `is_unset` |

For custom fields, pass the field slug as `field`.

**Rate limit:** 20 requests per minute

## Request body

- SearchAccountsRequest
  - `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 accounts to fetch. Defaults to 100. Must be greater than 0 and less than 1000.
  - `search_text` string — Fuzzy text search. Results are intersected with any provided filter.

## Response `200`

- SearchAccountsResponseBody
  - `data` Account[] — The data payload of the response.
    - `channels` Channel[] — Channels associated with the account.
      - `channel_id` string — The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.
      - `channel_name` string — The human-readable name of the channel.
      - `channel_url` string — The direct URL to the channel in its source app, if available.
      - `is_internal` boolean — Whether this is an internal channel (e.g., a triage channel) as opposed to a customer-facing channel.
      - `is_primary` boolean — Whether this channel is the primary channel for the account.
      - `mirror_to` MirrorChannel
        - `channel_id` string — The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.
        - `source` string — The channel source. This can be any supported integration source.
      - `source` string — The channel source. This can be any supported integration source.
    - `created_at` string — The creation time of the account.
    - `crm_settings` CRMSettings
      - `details` CRMDetails[] — List of all CRM details for the account.
        - `id` string — The ID of the CRM for that source.
        - `source` string — The source of the CRM.
    - `custom_fields` object — Custom fields associated with the account.
    - `domain` string — The primary domain of the account.
    - `domains` string[] — The list of domains associated with the account.
    - `external_ids` ExternalID[] — External IDs associated with the account.
      - `external_id` string — The external ID. Must be unique per object type (ex. account).
      - `label` string — The label of the external ID. Must be unique per object.
    - `id` string — The ID of the account.
    - `is_disabled` boolean — Whether the account is disabled.
    - `latest_customer_activity_time` string — The time of the latest customer activity.
    - `name` string — The name of the account.
    - `owner` MiniUser
      - `email` string — The email of the user.
      - `id` string — The ID of the user.
    - `primary_domain` string — The primary domain of the account.
    - `tags` string[] — Tags associated with the account.
    - `type` 'customer' | 'internal' | 'community' | 'partner' — The type of the account.
    - `updated_at` string — The time the account was last updated.
  - `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/cfd9e65e79bb/schema)
