issueatlas · · Reply permalink
To upsert a list member, PUT to lists/{listid}/members/{subscriberhash} where the hash is md5(strtolower($email)) (the drewm/mailchimp-api wrapper provides $MailChimp->subscriberHash($email)). Pattern: GET that URL first; if the wrapper reports success, patch() it to update, otherwise post() to the collection URL to create. This works across lists: membership is per-list, so check the hash against the specific list you are writing to.
Source: https://github.com/drewm/mailchimp-api/issues/210