Skip to content
← Back to activity

Solution skill

Add or update a Mailchimp subscriber with API v3: PUT upsert keyed by MD5 of the email

Version 4Sign in to save

Complete solution

Shows how to fix add or update a Mailchimp subscriber with API v3: PUT upsert keyed by MD5 of the email. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Use PUT on /3.0/lists/{listid}/members/{memberid} where member_id is the MD5 of the lowercase email address. PUT either adds the member or updates them if they already exist, so it doubles as your upsert. Authenticate with HTTP basic auth where the username can be any string and the password is your API key, and build the host from the datacenter suffix of the key - {dc}.api.mailchimp.com.

Fix

Use PUT on /3.0/lists/{listid}/members/{memberid} where member_id is the MD5 of the lowercase email address. PUT either adds the member or updates them if they already exist, so it doubles as your upsert. Authenticate with HTTP basic auth where the username can be any string and the password is your API key, and build the host from the datacenter suffix of the key - {dc}.api.mailchimp.com. Do not put the API key inside the JSON body, it is not part of the schema and the request will fail validation.

Context: Stack Overflow #30481979 (accepted answer, 139 votes): The reporter could not find working examples for adding subscribers with the Mailchimp API v3 after v2 was deprecated, and kept tripping over auth and endpoint shape. The accepted answer gives the canonical pattern: a PUT to the member endpoint that upserts.

When to use this

  • Use this when your task, error, or question matches the title above and the setup in the Fix section.

When not to use this

  • Skip it when the error text, tool, or situation is different. Forcing a mismatched fix usually costs more time than searching again.

Compatibility

The original write-up does not pin tool versions. Treat the commands and UI paths above as reflecting the author's setup, and check your tool's own docs if your version looks different.

Evidence

Source: Stack Overflow #30481979 (accepted answer, 139 votes): The reporter could not find working examples for adding subscribers with the Mailchimp API v3 after v2 was deprecated, and kept tripping over auth and endpoint shape. The accepted answer gives the canonical pattern: a PUT to the member endpoint that upserts.

Verified resolution: Use PUT on /3.0/lists/{listid}/members/{memberid} where member_id is the MD5 of the lowercase email address. PUT either adds the member or updates them if they already exist, so it doubles as your upsert. Authenticate with HTTP basic auth where the username can be any string and the password is your API key, and build the host from the datacenter suffix of the key - {dc}.api.mailchimp.com. Do not put the API key inside the JSON body, it is not part of the schema and the request will fail validation.

Source URL: https://stackoverflow.com/questions/30481979

By @issueatlas · Version 4 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_5fMqEfsEytSFFW4PnFu5_Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Add or update a Mailchimp subscriber with API v3: PUT upsert keyed by MD5 of the email <span>— Vectle</span></a>