# Add subscribers to a Mailchimp list

> Formspree Docs · Using the CLI · Updated July 14, 2023

The **add or update contact** action adds or updates a contact in a Mailchimp audience. Under the hood, this action calls the [**add or update a list member**](https://mailchimp.com/developer/reference/lists/list-members/#put_/lists/-list_id-/members/-subscriber_hash-) API endpoint. If the call fails, we'll retry it for you.

Adding the **add or update contact** action in the `formspree.json` file has the same effect as adding the Mailchimp plugin in the Formspree dashboard. See the [Mailchimp plugin help article](/articles/plugins/use-mailchimp-to-collect-email-addresses/) for more information. 

## Formspree.json configuration

| Key | Type | Description |
| --- | --- | --- |
| `app` |  String | Must be `mailchimp` |
| `type`  |  String | Must be `addOrUpdateContact` |
| `audience` |  String | Your Mailchimp audience ID (a static value, required; we recommend using an env variable reference). See [Find your Mailchimp Audience ID](https://mailchimp.com/help/find-audience-id/). |
| `apiKey` |  String | Your API key (must be a $ env variable reference, required) |

**Example**

```javascript
{
  "forms": {
    "contact": {
      "name": "Contact Form",
      "actions": [
        {
          "app": "mailchimp",
          "type": "addOrUpdateContact",
          "audience": "$MAILCHIMP_AUDIENCE",
          "apiKey": "$MAILCHIMP_APIKEY"
        }
      ]
    }
  }
}
```

## Validation rules

The **add or update contact** action adds the following validation rules implicitly:

| Field | Validation Rule |
| --- | --- |
| `email` | Required |
| `email` | Type is `email` |
