> ## 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

> Search saved Apollo contacts with stages, lists, sorting, and pagination.

`searchContacts` searches contacts saved in the connected workspace. Use
`searchPeople` for Apollo's broader prospect database.

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

export default automation("Find qualified contacts", () => {
  onHttpRequest({ scope: "automation" })
  searchContacts({ query: "engineering", stages: ["Qualified"], perPage: 50 })
})
```

| Input           | Type                                                                                                                                                | Required | Default         | Description                               |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------- | ----------------------------------------- |
| `query`         | `string`                                                                                                                                            | No       | None            | Name, title, employer, or email keywords. |
| `stages`        | `ApolloReference[]`                                                                                                                                 | No       | All             | Contact stages to include.                |
| `lists`         | `ApolloReference[]`                                                                                                                                 | No       | All             | Contact lists to include.                 |
| `sortBy`        | `"contact_created_at" \| "contact_email_last_clicked_at" \| "contact_email_last_opened_at" \| "contact_last_activity_date" \| "contact_updated_at"` | No       | Provider order  | Sort field.                               |
| `sortAscending` | `boolean`                                                                                                                                           | No       | `false`         | Sort oldest to newest.                    |
| `page`          | `number`                                                                                                                                            | No       | `1`             | One-based page.                           |
| `perPage`       | `number`                                                                                                                                            | No       | `100`           | Page size from 1 through 100.             |
| `account`       | `string \| IntegrationAccountReference<"apollo">`                                                                                                   | No       | Project default | Connected workspace.                      |

Returns `{ contacts: ApolloContact[]; pagination: ApolloPagination }`.
