# Update Contact — Omnisend

> Modify subscriber information or update their subscription status. See the documentation

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

## Description

Modify subscriber information or update their subscription status. [See the documentation](https://api-docs.omnisend.com/reference/patch_contacts-contactid)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactId` | `string` | Yes | The unique identifier of the contact to update. Options are loaded from the connected account. |
| `firstName` | `string` | No | The first name of the contact. |
| `lastName` | `string` | No | The last name of the contact. |
| `tags` | `string[]` | No | Tags are labels you create to organize and manage your audience. |
| `country` | `string` | No | The country of the contact. |
| `countryCode` | `string` | No | The ISO country code (2 characters). |
| `state` | `string` | No | The state of the contact. |
| `city` | `string` | No | The city of the contact. |
| `address` | `string` | No | The street address of the contact. |
| `postalCode` | `string` | No | The postal or zip code of the contact. |
| `gender` | `string` | No | The gender of the contact ('m' for male, 'f' for female). |
| `birthdate` | `string` | No | The birthdate of the contact in YYYY-MM-DD format. |
| `customProperties` | `object` | No | Custom properties for 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": "omnisend",
      },
    },
  },
)

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

---

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