# Create Lead — HelloLeads

> Adds a new lead into the HelloLeads system. See the documentation

- Key: `helloleads-create-lead`
- Type: Action (Write)
- Version: 0.0.2
- App: HelloLeads (`helloleads`) — https://pipedream.com/apps/helloleads.md
- This page (HTML): https://pipedream.com/apps/helloleads/actions/create-lead
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/helloleads/actions/create-lead/create-lead.mjs

## Description

Adds a new lead into the HelloLeads system. [See the documentation](https://github.com/PipedreamHQ/pipedream/files/13168532/HelloLeads_CRM_API_Documentation_POST_Method.pdf)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `listKey` | `string` | Yes | The key of the list. Options are loaded from the connected account. |
| `firstName` | `string` | Yes | First name of the lead. |
| `lastName` | `string` | No | Last name of the lead. |
| `designation` | `string` | No | Designation of the lead. |
| `company` | `string` | No | Lead organization name. |
| `email` | `string` | No | Primary email address of the lead. |
| `phone` | `integer` | No | Work phone number of the lead. |
| `mobile` | `integer` | No | Mobile phone number of the lead. |
| `fax` | `integer` | No | Fax number of the lead. |
| `addressLine1` | `string` | No | Address line1 of the lead. |
| `addressLine2` | `string` | No | Address line2 of the lead. |
| `city` | `string` | No | City that the lead belongs to. |
| `state` | `string` | No | State that the lead belongs to. |
| `postalCode` | `string` | No | Zip code of the region that the lead belongs to. |
| `country` | `string` | No | Country that the lead belongs to. |
| `website` | `string` | No | Website reference of the lead. |
| `notes` | `string` | No | Specify any other details about the lead. |
| `interests` | `string[]` | No | A list of Product/Interest which offered by you is interested to Lead. (Don't use special characters). |
| `category` | `string` | No | Customer group of a Lead. (Don't use special characters). |
| `tags` | `string[]` | No | Short tags (Tagging words) on lead. (Do not use special characters). |
| `mobileCode` | `string` | No | Mobile country code. |
| `dealSize` | `string` | No | Deal value of the business. |
| `potential` | `string` | No | How potential is the customer. By default, it will be Low. |

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

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: "helloleads-create-lead",
  arguments: {
    listKey: "List Key",
    firstName: "First Name",
  },
})
```

**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: "helloleads-create-lead",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    helloleads: { authProvisionId: "apn_xxxxxxx" },
    listKey: "List Key",
    firstName: "First Name",
  },
})

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": "helloleads-create-lead",
    "configured_props": {
      "helloleads": { "authProvisionId": "apn_xxxxxxx" },
      "listKey": "List Key",
      "firstName": "First Name"
    }
  }'
```

---

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