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

> Searches opportunities with pipeline, status, owner, and pagination filters.

`highlevel.searchOpportunities` searches opportunities with pipeline, status, owner, and pagination filters.

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

export default automation("Search opportunities", () => {
  markSignificant(
    highlevel.searchOpportunities({
      pipelineId: "bCkKGpDsyPP4peuKowkG",
    }),
  )
})
```

## Input

| Field               | Type                                      | Required | Description                          |
| ------------------- | ----------------------------------------- | -------- | ------------------------------------ |
| `q`                 | `string`                                  | No       | HighLevel q value.                   |
| `pipelineId`        | `string`                                  | No       | HighLevel pipeline ID.               |
| `pipelineStageId`   | `string`                                  | No       | HighLevel pipeline stage ID.         |
| `contactId`         | `string`                                  | No       | HighLevel contact ID.                |
| `status`            | `open \| won \| lost \| abandoned \| all` | No       | HighLevel status value.              |
| `assignedTo`        | `string`                                  | No       | HighLevel assigned user ID.          |
| `campaignId`        | `string`                                  | No       | HighLevel campaign id value.         |
| `id`                | `string`                                  | No       | HighLevel id value.                  |
| `order`             | `string`                                  | No       | HighLevel order value.               |
| `endDate`           | `string`                                  | No       | HighLevel end date value.            |
| `startAfter`        | `string`                                  | No       | HighLevel start after value.         |
| `startAfterId`      | `string`                                  | No       | HighLevel start after id value.      |
| `date`              | `string`                                  | No       | HighLevel date value.                |
| `country`           | `string`                                  | No       | HighLevel country value.             |
| `page`              | `number`                                  | No       | HighLevel page value.                |
| `limit`             | `number`                                  | No       | HighLevel limit value.               |
| `getTasks`          | `boolean`                                 | No       | HighLevel get tasks value.           |
| `getNotes`          | `boolean`                                 | No       | HighLevel get notes value.           |
| `getCalendarEvents` | `boolean`                                 | No       | HighLevel get calendar events value. |

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

## Output

| Field           | Type       | Required | Description                    |
| --------------- | ---------- | -------- | ------------------------------ |
| `opportunities` | `object[]` | No       | HighLevel opportunities value. |
| `meta`          | `object`   | No       | HighLevel meta value.          |
| `aggregations`  | `object`   | No       | HighLevel aggregations value.  |

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