MailChimp resubscribe a deleted member causes the API to return a 400 bad request

JohnnyQ picture JohnnyQ · Sep 6, 2018 · Viewed 11.9k times · Source

I've encountered a problem on MailChimp v3 API where it responds with a status 400 when I try to resubcribe a member. Here's the steps to reproduce the problem:

  1. Subscribe a member to a list then delete that member.
  2. Resubscribe using the API through endpoint PUT /lists/{list_id}/members/{subscriber_hash} returns a status 400

    { 'type': 'http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/', 'title': 'Forgotten Email Not Subscribed', 'status': 400, 'detail': '[email protected] was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list.' }

and the request is:

{
  email_address: '[email protected]',
  status_if_new: 'subscribed'
}

Based on the response the solution is the member must be resubscribed which I'm actually trying to do. Anyone encountered this problem?

Answer

JohnnyQ picture JohnnyQ · Sep 18, 2018

I've contact MC support and this is what they gave me:

Due to the GDPR requirements for EU, we recently added a new way to delete contacts from your list. At this time, you can delete and archive (which is a soft delete and keeps that contact in your reports) or you can delete and remove (which is a hard delete and removes those contacts from all reporting / etc). Seeing this error message means you are trying to re-add someone that had been previously permanently deleted. If you intend to delete someone and re-add them via the API, you want to use the delete and archive option.

The only confusing part for me was that I was asked to resubscribe when in fact it was the very thing I was doing, but the support team also told me that:

When seeing the message for 'resubscribe', this is referring to using a MailChimp signup form as opposed to using an API subscribe method. The MailChimp forms are the ultimate 'workaround' in which it can be used to resubscribe unsubscribers, cleaned addresses or permanently deleted addresses.

In summary, there is nothing wrong the code it's just how MC treats that request from their API which I believe shouldn't be as misleading as the error message says.

So there you go, I hope this helps someone who's been in the same painful path of discovering that there's nothing wrong with your code and that was just simply how their API worked. ¯_(ツ)_/¯