# Find Lead — WhatConverts

> Find a lead in WhatConverts. See the documentation

- Key: `whatconverts-find-lead`
- Type: Action (Read-only)
- Version: 0.0.2
- App: WhatConverts (`whatconverts`) — https://pipedream.com/apps/whatconverts.md
- This page (HTML): https://pipedream.com/apps/whatconverts/actions/find-lead
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/whatconverts/actions/find-lead/find-lead.mjs

## Description

Find a lead in WhatConverts. [See the documentation](https://www.whatconverts.com/api/leads/#get-all-leads)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountId` | `integer` | No | Your WhatConverts Account ID Options are loaded from the connected account. |
| `profileId` | `integer` | No | The ID of the profile the lead belongs to Options are loaded from the connected account. |
| `leadType` | `string` | No | Lead type to return for this request |
| `leadStatus` | `string` | No | Lead status to return for this request |
| `startDate` | `string` | No | Start date for this request in date or date/time ISO 8601 format (UTC); 2015-11-10 or 2015-11-10T00:00:00Z. Date range can include up to 400 days. |
| `endDate` | `string` | No | End date for this request in date or date/time ISO 8601 format (UTC); 2015-11-10 or 2015-11-10T00:00:00Z. Date range can include up to 400 days. |
| `order` | `string` | No | Order in which to return the leads by date created |
| `quotable` | `string` | No | Quotable type to return for this request |
| `quoteValue` | `string` | No | Return leads that have a quote value |
| `salesValue` | `string` | No | Return leads that have a sales value |
| `phoneNumber` | `string` | No | Return leads for the contacts that have this E.164 formatted phone number |
| `emailAddress` | `string` | No | Return leads for the contact that have this email address |
| `spam` | `boolean` | No | If true will return only spam leads |
| `duplicate` | `boolean` | No | If true will return only duplicate leads |
| `leadSource` | `string` | No | Return leads that have this lead source |
| `leadMedium` | `string` | No | Return leads that have this lead medium |
| `leadCampaign` | `string` | No | Return leads that have this lead campaign |
| `leadContent` | `string` | No | Return leads that have this lead content |
| `leadKeyword` | `string` | No | Return leads that have this lead keyword |
| `maxResults` | `integer` | No | The maximum number of results to return. Default: 100, Maximum: 2500 |

## 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": "whatconverts",
      },
    },
  },
)

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: "whatconverts-find-lead",
  arguments: {
    accountId: 10,
    profileId: 10,
  },
})
```

**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: "whatconverts-find-lead",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    whatconverts: { authProvisionId: "apn_xxxxxxx" },
    accountId: 10,
    profileId: 10,
  },
})

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": "whatconverts-find-lead",
    "configured_props": {
      "whatconverts": { "authProvisionId": "apn_xxxxxxx" },
      "accountId": 10,
      "profileId": 10
    }
  }'
```

---

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