# Create Contact — OnePageCRM

> Creates a new contact in OnePageCRM. See the documentation

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

## Description

Creates a new contact in OnePageCRM. [See the documentation](https://developer.onepagecrm.com/api/#/Contacts/post_contacts)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `title` | `string` | No | The title of the contact. |
| `firstName` | `string` | No | First name of the contact. |
| `lastName` | `string` | No | Last name of the contact. |
| `jobTitle` | `string` | No | Job title of the contact. |
| `starred` | `boolean` | No | Is the contact starred? |
| `companyId` | `string` | No | ID of the company, to which the contact belongs. Options are loaded from the connected account. |
| `companyName` | `string` | No | Name of the company, to whom the contact belongs. |
| `tags` | `string[]` | No | A list of tags. |
| `leadSourceId` | `string` | No | ID of the lead source. Options are loaded from the connected account. |
| `background` | `string` | No | Background infomation about the contact. |
| `ownerId` | `string` | No | ID of the user, to whom the contact belongs. Options are loaded from the connected account. |

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

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: "onepagecrm-create-contact",
  arguments: {
    title: "Title",
    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: "onepagecrm-create-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    onepagecrm: { authProvisionId: "apn_xxxxxxx" },
    title: "Title",
    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": "onepagecrm-create-contact",
    "configured_props": {
      "onepagecrm": { "authProvisionId": "apn_xxxxxxx" },
      "title": "Title",
      "firstName": "First Name"
    }
  }'
```

---

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