# Create Contact — Salesflare

> Create a contact See the docs here

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

## Description

Create a contact [See the docs here](https://api.salesflare.com/docs#operation/postContacts)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `owner` | `integer` | No | Owner ID Options are loaded from the connected account. |
| `account` | `integer` | No | Contact account. Any existing account will be removed from the contact when specifically passing null! Options are loaded from the connected account. |
| `email` | `string` | No | Email. Max 1000 characters |
| `prefix` | `string` | No | Contact prefix |
| `firstname` | `string` | No | Firstname of the contact |
| `middle` | `string` | No | Middlename of the contact |
| `lastname` | `string` | No | Lastname of the contact |
| `suffix` | `string` | No | Suffix of the contact |
| `name` | `string` | No | Name of the contact |
| `birthDate` | `string` | No | Birth date of contact. Must be in ISO format. e.g. 1990-11-17T08:07:00Z |
| `tags` | `string[]` | No | Tags |
| `city` | `string` | No | City (address) |
| `country` | `string` | No | Country (address) |
| `stateRegion` | `string` | No | State region (address) |
| `street` | `string` | No | Street (address) |
| `zip` | `string` | No | Zip (address) |
| `phoneNumber` | `string` | No | Phone number |
| `socialProfiles` | `string[]` | No | Social profile links. |
| `faxNumber` | `string` | No | Fax number of the contact |
| `organisaton` | `string` | No | Organisation (position) |
| `role` | `string` | No | Role (position) |
| `custom` | `object` | No | Custom fields |

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

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: "salesflare-create-contact",
  arguments: {
    owner: 10,
    account: 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: "salesflare-create-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    salesflare: { authProvisionId: "apn_xxxxxxx" },
    owner: 10,
    account: 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": "salesflare-create-contact",
    "configured_props": {
      "salesflare": { "authProvisionId": "apn_xxxxxxx" },
      "owner": 10,
      "account": 10
    }
  }'
```

---

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