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.

## 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
