# Update Contact — Constant Contact

> Update an existing contact. See the documentation

- Key: `constant_contact-update-contact`
- Type: Action (Write)
- Version: 0.0.4
- App: Constant Contact (`constant_contact`) — https://pipedream.com/apps/constant-contact.md
- This page (HTML): https://pipedream.com/apps/constant-contact/actions/update-contact
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/constant_contact/actions/update-contact/update-contact.mjs

## Description

Update an existing contact. [See the documentation](https://developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactId` | `string` | Yes | Unique ID of contact Options are loaded from the connected account. |
| `emailAddress` | `string` | No | The contact's email address. |
| `permissionToSend` | `string` | No | Identifies the type of permission that the Constant Contact account has been granted to send email to the contact. |
| `firstName` | `string` | No | The first name of the contact. |
| `lastName` | `string` | No | The last name of the contact. |
| `jobTitle` | `string` | No | The job title of the contact. |
| `companyName` | `string` | No | The name of the company where the contact works. |
| `updateSource` | `string` | Yes | Describes who updated the contact. Your integration must accurately identify update_source for compliance reasons. |
| `birthdayMonth` | `string` | No | The month value for the contact's birthday. The birthdayMonth is required if you use birthdayDay. |
| `birthdayDay` | `string` | No | The day value for the contact's birthday. The birthdayDay is required if you use birthdayMonth. |
| `anniversary` | `string` | No | The anniversary date for the contact. For example, this value could be the date when the contact first became a customer of an organization in Constant Contact. Valid date formats are MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY, or M-DD-YYYY. |
| `numberOfPhoneNumbers` | `integer` | No | The number of phone numbers of the contact. |
| `numberOfStreetAddresses` | `integer` | No | The number of street addresses of the contact. |
| `listMemberships` | `string[]` | No | Array of lists to which the contact is being subscribed, up to a maximum of 50. Options are loaded from the connected account. |
| `taggings` | `string[]` | No | Array of tags assigned to the contact, up to a maximum of 50. Options are loaded from the connected account. |
| `numberOfNotes` | `integer` | No | The number of notes in the contact. |

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

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: "constant_contact-update-contact",
  arguments: {
    contactId: "Contact Id",
    emailAddress: "Email Address",
  },
})
```

**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: "constant_contact-update-contact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    constant_contact: { authProvisionId: "apn_xxxxxxx" },
    contactId: "Contact Id",
    emailAddress: "Email Address",
  },
})

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": "constant_contact-update-contact",
    "configured_props": {
      "constant_contact": { "authProvisionId": "apn_xxxxxxx" },
      "contactId": "Contact Id",
      "emailAddress": "Email Address"
    }
  }'
```

---

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