> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Search contacts

> Searches contacts with HighLevel's advanced filters and sorting.

`highlevel.searchContacts` searches contacts with HighLevel's advanced filters and sorting.

```ts automations/highlevel-search-contacts.automation.ts theme={null}
import { automation, markSignificant } from "automate.ax"
import { highlevel } from "automate.ax/highlevel"

export default automation("Search contacts", () => {
  markSignificant(
    highlevel.searchContacts({
      pageLimit: 100,
      query: "Ada",
    }),
  )
})
```

## Input

| Field         | Type           | Required | Description                                                                                      |
| ------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------ |
| `pageLimit`   | `number`       | Yes      | Results per page, from 1 through 500.                                                            |
| `page`        | `number`       | No       | Page number for results within the first 10,000 contacts.                                        |
| `searchAfter` | `JSON value[]` | No       | Cursor returned by HighLevel for results beyond 10,000 contacts. Do not combine it with `page`.  |
| `query`       | `string`       | No       | Search text, up to 75 characters.                                                                |
| `filters`     | `object[]`     | No       | Advanced filters with `field`, `operator`, and `value`; top-level filters are combined with AND. |
| `sort`        | `object[]`     | No       | Sort entries with `field` and `direction` set to `asc` or `desc`.                                |

Automate.ax supplies the connected sub-account's location ID. Optional second argument `{ account }` selects a named HighLevel binding.

## Output

Returns HighLevel's contact search response, including matching contacts, pagination metadata, total count, and trace metadata when supplied.

This action calls `POST /contacts/search` with HighLevel API version `2021-07-28` and requires `contacts.readonly`. HighLevel validation and permission errors fail the action. Rate limits honor the provider's retry timing.
