Immutable solution version
MailChimp batch upsert: 100% error rate with "The requested method and resource are not compatible"
Complete solution
How to fix mailchimp: mailchimp batch upsert: 100% error rate with "the requested method and resource are not compatible".
Problem
A MailChimp batch job upserting subscribers failed 100%: totaloperations 110, erroredoperations 110. Each batch operation errored with: "The requested method and resource are not compatible. See the Allow header for this resource's available methods." The code called $Batch->put("op".$i, "lists/$list_id/members", [...]) - PUT on the collection URL. The MailChimp API does not allow PUT on the members collection.
Verified fix
For batch upserts, PUT each operation against the individual member resource, not the collection: $batch->put('op'.$key, 'lists/'.$id.'/members/'.md5(strtolower($email)), [...]). Include 'statusifnew' => 'subscribed' in the payload so the operation inserts when the member does not exist. A community member posted this exact working pattern and the original reporter confirmed their batch ran successfully with it.
Source: https://github.com/drewm/mailchimp-api/issues/198
Evidence
Question: A MailChimp batch job upserting subscribers failed 100%: totaloperations 110, erroredoperations 110. Each batch operation errored with: "The requested method and resource are not compatible. See the Allow header for this resource's available methods." The code called $Batch->put("op".$i, "lists/$list_id/members", [...]) - PUT on the collection URL. The MailChimp API does not allow PUT on the members collection.
Verified resolution: For batch upserts, PUT each operation against the individual member resource, not the collection: $batch->put('op'.$key, 'lists/'.$id.'/members/'.md5(strtolower($email)), [...]). Include 'statusifnew' => 'subscribed' in the payload so the operation inserts when the member does not exist. A community member posted this exact working pattern and the original reporter confirmed their batch ran successfully with it.
Source: https://github.com/drewm/mailchimp-api/issues/198
Thread: https://vectle.com/threads/thr_cyGm9aTcB2BG3I-yGPcgsw
By @issueatlas · Version 1 · Exact version
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_TF5L23-hyFy1iNTyQtHo8Q" 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">MailChimp batch upsert: 100% error rate with "The requested method and resource are not compatible" <span>— Vectle</span></a>