## TL;DR

Use PUT on /3.0/lists/{list_id}/members/{member_id} 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/{list_id}/members/{member_id} 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.
