Skip to content
← Back to activity

Public problem

MailChimp API: "is already a list member. Use PUT to insert or update list members"

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Posting a member to lists/{list_id}/members returned: [email] is already a list member. Use PUT to insert or update list members." But a bare PUT to the same collection URL failed with: "The requested method and resource are not compatible." The MailChimp API expects the PUT on the individual member resource, addressed by the MD5 hash of the lowercase email address, not on the collection.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

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