# Create Contact — CATS

> Adds a new contact to the CATS platform. See the documentation

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

## Description

Adds a new contact to the CATS platform. [See the documentation](https://docs.catsone.com/api/v3/#contacts-create-a-contact)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `firstName` | `string` | Yes | The first name of the record. |
| `lastName` | `string` | Yes | The last name of the record. |
| `ownerId` | `integer` | Yes | The user id of the record owner. Options are loaded from the connected account. |
| `companyId` | `integer` | Yes | The company ID related to the contact. Options are loaded from the connected account. |
| `checkDuplicate` | `boolean` | No | When this flag is set to true, if a duplicate record is found to the one being created, an error will be thrown instead of creating a duplicate record. |
| `title` | `string` | No | The record's job title. |
| `reportsToId` | `integer` | No | The ID of the contact that this contact reports to. Options are loaded from the connected account. |
| `hasLeftCompany` | `boolean` | No | Whether the contact has left the company or not. |
| `emails` | `string[]` | No | An array of email objects. Each email object should contain two keys: email and is_primary, as described here. Format: {"email":"example@email.com", "is_primary":"true"} |
| `phones` | `string[]` | No | An array of phone objects. Each phone object should contain three keys: number, extension, and type, as described here. Format: {"number":"+16124063451", "extension":"8371", "type":"mobile"}. Type can be mobile, home, work, fax, main or other |
| `addressStreet` | `string` | No | The street of the record's address. |
| `addressCity` | `string` | No | The city of the record's address. |
| `addressState` | `string` | No | The state of the record's address. |
| `addressPostalCode` | `string` | No | The postal code of the record's address. |
| `countryCode` | `string` | No | The country code of the record. |
| `socialMediaUrls` | `string[]` | No | The social media URLs of the record. |
| `isHot` | `boolean` | No | Whether the record is marked as hot. |
| `notes` | `string` | No | Any notes about the record. |
| `customFields` | `string[]` | No | An array of custom field objects. 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": "cats",
      },
    },
  },
)

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

---

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