# Update List — Mailchimp

> Updates an existing list. See docs here

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

## Description

Updates an existing list. [See docs here](https://mailchimp.com/developer/marketing/api/lists/update-lists/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `listId` | `string` | Yes | The unique ID of the list Options are loaded from the connected account. |
| `name` | `string` | Yes | The name of the list. |
| `contactCompany` | `string` | Yes | The company name for the list. |
| `contactAddress1` | `string` | Yes | The street address for the list contact. |
| `contactCity` | `string` | Yes | The city for the list contact. |
| `contactState` | `string` | Yes | The state for the list contact. |
| `contactCountry` | `string` | Yes | A two-character ISO3166 country code. Defaults to US if invalid. |
| `contactPhone` | `string` | No | The phone number for the list contact. |
| `contactZip` | `string` | No | The postal or zip code for the list contact. |
| `permissionReminder` | `string` | Yes | The permission reminder for the list. |
| `campaignDefaultsFromName` | `string` | Yes | The default from name for campaigns sent to this list. |
| `campaignDefaultsFromEmail` | `string` | Yes | The default from email for campaigns sent to this list. |
| `campaignDefaultsSubject` | `string` | Yes | The default subject line for campaigns sent to this list. |
| `campaignDefaultsLanguage` | `string` | Yes | The default language for this lists's forms. |
| `emailTypeOption` | `boolean` | Yes | Whether the list supports multiple formats for emails. |

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

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: "mailchimp-update-list",
  arguments: {
    listId: "List Id",
    name: "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: "mailchimp-update-list",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mailchimp: { authProvisionId: "apn_xxxxxxx" },
    listId: "List Id",
    name: "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": "mailchimp-update-list",
    "configured_props": {
      "mailchimp": { "authProvisionId": "apn_xxxxxxx" },
      "listId": "List Id",
      "name": "Name"
    }
  }'
```

---

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