# List Leads — Hunter

> List all your leads with comprehensive filtering options. The leads are returned in sorted order, with the most recent leads appearing first. See the documentation.

- Key: `hunter-list-leads`
- Type: Action (Read-only)
- Version: 0.0.3
- App: Hunter (`hunter`) — https://pipedream.com/apps/hunter.md
- This page (HTML): https://pipedream.com/apps/hunter/actions/list-leads
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/hunter/actions/list-leads/list-leads.mjs

## Description

List all your leads with comprehensive filtering options. The leads are returned in sorted order, with the most recent leads appearing first. [See the documentation](https://hunter.io/api-documentation/v2#leads).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `leadsListId` | `string` | No | Only returns the leads belonging to this list. Options are loaded from the connected account. |
| `email` | `string` | No | Filter leads by email. Use * for any value, ~ for empty, or specific email. |
| `firstName` | `string` | No | Filter leads by first name. Use * for any value, ~ for empty, or specific name. |
| `lastName` | `string` | No | Filter leads by last name. Use * for any value, ~ for empty, or specific name. |
| `position` | `string` | No | Filter leads by position. Use * for any value, ~ for empty, or specific position. |
| `company` | `string` | No | Filter leads by company. Use * for any value, ~ for empty, or specific company. |
| `industry` | `string` | No | Filter leads by industry. Use * for any value, ~ for empty, or specific industry. |
| `website` | `string` | No | Filter leads by website. Use * for any value, ~ for empty, or specific website. |
| `countryCode` | `string` | No | Filter leads by country code (ISO 3166-1 alpha-2). Use * for any value, ~ for empty. |
| `companySize` | `string` | No | Filter leads by company size. Use * for any value, ~ for empty, or specific size. |
| `source` | `string` | No | Filter leads by source. Use * for any value, ~ for empty, or specific source. |
| `twitter` | `string` | No | Filter leads by Twitter handle. Use * for any value, ~ for empty, or specific handle. |
| `linkedinUrl` | `string` | No | Filter leads by LinkedIn URL. Use * for any value, ~ for empty, or specific URL. |
| `phoneNumber` | `string` | No | Filter leads by phone number. Use * for any value, ~ for empty, or specific number. |
| `syncStatus` | `string` | No | Only returns the leads matching this synchronization status. |
| `sendingStatus` | `string[]` | No | Only returns the leads matching these sending status(es). |
| `verificationStatus` | `string[]` | No | Only returns the leads matching these verification status(es). |
| `lastActivityAt` | `string` | No | Only returns the leads matching this last activity. |
| `lastContactedAt` | `string` | No | Only returns the leads matching this last contact date. |
| `query` | `string` | No | Only returns the leads with First Name, Last Name, or Email matching the query. |
| `limit` | `integer` | Yes | A limit on the number of leads to be returned. Limit can range between 1 and 1,000. Default is 20. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "hunter",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "hunter-list-leads",
  arguments: {
    leadsListId: "Leads List ID",
    email: "Email",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "hunter-list-leads",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    hunter: { authProvisionId: "apn_xxxxxxx" },
    leadsListId: "Leads List ID",
    email: "Email",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "hunter-list-leads",
    "configured_props": {
      "hunter": { "authProvisionId": "apn_xxxxxxx" },
      "leadsListId": "Leads List ID",
      "email": "Email"
    }
  }'
```

---

- App: https://pipedream.com/apps/hunter.md · All apps: https://pipedream.com/apps
