# Adding Subscribers via Zapier

Connect Mailnaptic to Zapier for subscriber automation

Zapier connects Mailnaptic to thousands of apps — forms, CRMs, e-commerce platforms, spreadsheets, and more. By creating a Zap, you can automatically add new subscribers to your Mailnaptic lists whenever an event occurs in another app.

## Prerequisites

- A Zapier account (free tier works for basic Zaps).
- A Mailnaptic API key with **contacts:write** and **lists:read** permissions. Generate one at **Organization → API Keys**.

## Setting up the Zap

### Step 1: Choose your trigger app

In Zapier, click **Create Zap** and select the trigger app — the source of new subscribers. Common triggers:

- **Google Forms** — new form submission
- **Shopify** — new customer
- **Typeform** — new entry
- **Google Sheets** — new row added
- **Facebook Lead Ads** — new lead

Configure the trigger according to the app's instructions and test it to confirm sample data flows through.

### Step 2: Add the Mailnaptic action

For the action step, choose **Webhooks by Zapier** (Custom Request). Configure it as follows:

| Field | Value |
| --- | --- |
| Method | `POST` |
| URL | `https://your-api-domain/contacts` |
| Payload Type | `JSON` |
| Headers | `Authorization: Bearer YOUR_API_KEY` `Content-Type: application/json` |

### Step 3: Map fields

In the request body, map fields from the trigger to Mailnaptic's contact schema:

```
{
  "email": "{{trigger_email_field}}",
  "first_name": "{{trigger_first_name}}",
  "last_name": "{{trigger_last_name}}",
  "list_ids": [YOUR_LIST_ID],
  "tags": ["zapier-import"]
}
```

Replace the placeholder fields with Zapier's mapped data from the trigger step. You can find your list ID in Mailnaptic by opening the list and checking the URL.

### Step 4: Test and enable

1. Click **Test** in Zapier to send a sample contact to Mailnaptic.
2. Verify the contact appears in your Mailnaptic contacts list with the correct fields and tags.
3. Turn the Zap **On**.

## Handling duplicates

Mailnaptic's contact creation uses upsert behavior — if a contact with the same email already exists, the existing record is updated rather than creating a duplicate. This means your Zap can safely run for returning customers or repeat form submissions without creating duplicate contacts.

## Advanced: Updating existing contacts

To update contact fields (e.g., add a new tag or change a custom field), use the `PUT` method to `/contacts/:id` or continue using `POST /contacts` with the upsert behavior.

## Troubleshooting

- **401 Unauthorized:** Check that your API key is correct and has the required scopes.
- **400 Bad Request:** Verify the JSON body is valid and the `email` field is present.
- **Zap not firing:** Ensure the Zap is turned on and the trigger app is generating events.

> **Tip:** Add a `"tags": ["zapier-import"]` field to every Zap so you can easily identify and segment contacts that came through Zapier.
