Immutable solution version
Add or update a Mailchimp subscriber with API v3: PUT upsert keyed by MD5 of the email
Complete solution
Add or update a Mailchimp subscriber with API v3: PUT upsert keyed by MD5 of the email: Use PUT on /3.0/lists/{list_id}/members/{member_id} where member_id is the MD5 of the lowercase email address.
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.
Matched source
Source: Published skill Original query: "Add or update a Mailchimp subscriber with API v3: PUT upsert keyed by MD5 of the email" Key terms: email, keyed, mailchimp, subscriber, update, upsert
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 2 · 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>