# Create Contact — Agiliron

> Generates a new contact within Agiliron. See the documentation

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

## Description

Generates a new contact within Agiliron. [See the documentation](https://api.agiliron.com/docs/add-contact-1)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `salutation` | `string` | No | The salutation of the lead |
| `lastname` | `string` | Yes | The last name of the contact. |
| `firstName` | `string` | No | The first name of the contact |
| `officePhone` | `string` | No | The office phone number of the contact |
| `mobile` | `string` | No | The mobile number of the contact |
| `homePhone` | `string` | No | The home phone number of the contact |
| `otherPhone` | `string` | No | An additional phone number of the contact |
| `fax` | `string` | No | The fax number of the contact |
| `accountName` | `string` | No | The account name of the contact |
| `accountId` | `string` | No | The account id of the contact |
| `vendorName` | `string` | No | The vendor name of the contact |
| `vendorId` | `string` | No | The vendor id of the contact |
| `contactType` | `string` | No | The contact type of the contact |
| `title` | `string` | No | The title of the contact. |
| `department` | `string` | No | The department of the contact. |
| `email` | `string` | No | The email address of the contact |
| `yahooId` | `string` | No | The Yahoo ID of the contact |
| `emailOptOut` | `string` | No | The email opt-out status of the contact |
| `assignedTo` | `string` | No | The user to whom the contact is assigned |
| `leadSource` | `string` | No | The lead source of the contact |
| `birthday` | `string` | No | The birthday of the contact. |
| `mailingStreet` | `string` | No | The mailing street address of the contact |
| `mailingCity` | `string` | No | The mailing city of the contact |
| `mailingState` | `string` | No | The mailing state of the contact |
| `mailingZip` | `string` | No | The mailing zip code of the contact |
| `mailingCountry` | `string` | No | The mailing country of the contact |
| `otherStreet` | `string` | No | The other street address of the contact |
| `otherCity` | `string` | No | The other city of the contact |
| `otherState` | `string` | No | The other state of the contact |
| `otherZip` | `string` | No | The other zip code of the contact |
| `otherCountry` | `string` | No | The other country of the contact |
| `description` | `string` | No | The description of the contact |
| `customFields` | `object` | No | An object of custom fields for the contact. Format: {customFieldName01: "Value 01"} |

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

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

---

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