# Update Contact — Givebutter

> Update an existing Givebutter contact, returning the updated contact object. Set only the fields you want to change. Use List Contacts first to find the contact ID. Note that Givebutter validates this as a full update — individual contacts…

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

## Description

Update an existing Givebutter contact, returning the updated contact object. Set only the fields you want to change. Use **List Contacts** first to find the contact ID. Note that Givebutter validates this as a full update — individual contacts require `first_name` and `last_name`, and company contacts require `company_name`, even when those values are not changing — so this action reads the contact first and re-sends its existing name and company values automatically. [See the documentation](https://docs.givebutter.com/api-reference/contacts/update-a-contact)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactId` | `string` | Yes | The ID of the contact to update (an integer identifier, e.g. 12345). Run List Contacts to find valid contact IDs. |
| `firstName` | `string` | No | Contact's first name (max 255 chars). Maps to the API first_name field. |
| `lastName` | `string` | No | Contact's last name (max 255 chars). Maps to the API last_name field. |
| `email` | `string` | No | Email address to set on the contact, submitted in the API emails array. Example: jane.updated@example.com. Becomes the contact's primary email unless Email Is Primary is set to false. |
| `emailIsPrimary` | `boolean` | No | Whether Email becomes the contact's primary email address (the API is_primary flag). Defaults to true; set to false to add it as a secondary address, leaving the existing primary in place. Ignored when Email is not set. |
| `phone` | `string` | No | Phone number to set on the contact, submitted in the API phones array. Example: +15555550100. Becomes the contact's primary phone unless Phone Is Primary is set to false. |
| `phoneIsPrimary` | `boolean` | No | Whether Phone becomes the contact's primary phone number (the API is_primary flag). Defaults to true; set to false to add it as a secondary number, leaving the existing primary in place. Ignored when Phone is not set. |
| `companyName` | `string` | No | Company name (max 255 chars). Maps to the API company_name field. |
| `note` | `string` | No | Optional note to set on the contact. |
| `tags` | `string[]` | No | Optional list of tag strings to set on the contact (max 64 tags), replacing the contact's existing tags. Example: ["vip", "newsletter"]. |

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

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

---

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