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

> Search CloseBot leads with source, bot, persona, and conversation filters.

`closeBot.searchLeads` searches conversations using CloseBot's full lead-search endpoint.

```ts automations/search-closebot-leads.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { closeBot } from "automate.ax/closebot"

export default automation("Search CloseBot leads", () => {
  onDashboardRun({ title: "Search leads" })

  closeBot.searchLeads({
    sourceIds: ["source-id"],
    botIds: [],
    personaIds: [],
    channels: ["sms"],
    search: "Ada",
  })
})
```

## Inputs

Provide `sourceIds`, `botIds`, `personaIds`, and `channels`; use empty arrays when a dimension is unrestricted. Optional filters cover text, offset/count, response count, last-message direction, scheduled follow-ups, starred leads, and mentions.

## Output

Returns matching leads and total counts.
