# Update Contact — Apollo (API Key)

> Updates an existing contact in Apollo.io. See the documentation

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

## Description

Updates an existing contact in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-a-contact)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactId` | `string` | Yes | Identifier of the contact to update Options are loaded from the connected account. |
| `email` | `string` | No | Email address of the contact |
| `firstName` | `string` | No | First name of the contact |
| `lastName` | `string` | No | Last name of the contact |
| `title` | `string` | No | The title this contact |
| `accountId` | `string` | No | Identifier of the account for this contact Options are loaded from the connected account. |
| `websiteUrl` | `string` | No | The organization website Apollo can use to enrich data for you. DO NOT pass in personal social media URLs such as "http://www.linkedin.com/profile_url", or your data will be incorrectly enriched. This argument will be ignored if you pass in a valid email. |
| `labelNames` | `string[]` | No | A list of names to tag this contact. You can select the labels from the list or create new ones using a custom expression, i.e., ["label1", "label2"] Options are loaded from the connected account. |
| `address` | `string` | No | The address string for this contact, Apollo will intelligently infer the city, state, country, and time zone from your address |
| `phone` | `string` | No | The direct dial phone for this 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": "apollo_io",
      },
    },
  },
)

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: "apollo_io-update-contact",
  arguments: {
    contactId: "Contact ID",
    email: "Email",
  },
})
```

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

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": "apollo_io-update-contact",
    "configured_props": {
      "apollo_io": { "authProvisionId": "apn_xxxxxxx" },
      "contactId": "Contact ID",
      "email": "Email"
    }
  }'
```

---

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