# Create Contact — PostGrid Print & Mail

> Create a new contact in PostGrid. See the documentation

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

## Description

Create a new contact in PostGrid. [See the documentation](https://docs.postgrid.com/#3ac81e66-c5be-4bb6-93c1-fd8a6f0a24b3)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `firstName` | `string` | Yes | The first name of the contact. |
| `lastName` | `string` | No | The last name of the contact. |
| `companyName` | `string` | No | The contact's company name. |
| `addressLine1` | `string` | Yes | The contact's first address line. |
| `addressLine2` | `string` | No | The contact's second address line. |
| `city` | `string` | No | The contact's city. |
| `provinceOrState` | `string` | No | The province or state of the contact. |
| `email` | `string` | No | The contact's email. |
| `phoneNumber` | `string` | No | The contact's phone number. |
| `jobTitle` | `string` | No | The contact's job title. |
| `postalOrZip` | `string` | No | The postal code or ZIP code of the contact. |
| `countryCode` | `string` | No | The ISO 3611-1 country code of the contact's address. Defaults to CA. |
| `description` | `string` | No | A description for the contact. |
| `skipVerification` | `boolean` | No | If true, skip address verification and mark the address as failed. |

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

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

---

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