Errors
The basics
The Mailchimp Marketing API will return a variety of errors if anything goes wrong with your API calls. Every error has an HTTP status code, and will also return an error type and brief explanation when the error is triggered. This documentation provides additional explanations of these errors and guidance on how to avoid them.
When you use any API, keep in mind that errors and exceptions (e.g., server connection problems or outages) are rare, but they do happen. To make sure that your integration is as reliable as it can be, you should always watch for errors and exceptions.
If your API call returns an error, log the call in as much detail as you can. If you need to contact support, we recommend including the complete request you’re trying to make, the error code, and the response you’re receiving so they can help as quickly as possible.
Error format
We expose API errors in two ways: standard HTTP response codes and human-readable messages in JSON format.
Here’s an HTTP 405 error in both formats:
Common causes
4xx status codes suggest a bad request. If you receive a 4xx response, the error glossary below offers more context to help you troubleshoot.
5xx status codes suggest a problem on Mailchimp’s end. If you receive a 5xx error, we recommend checking @MailchimpStatus on Twitter to see if we are experiencing any system-wide issues.
If you receive an HTTP 502 error with an HTML body, your request may have timed out and been closed by our CDN. Contact support for help resolving.
To test error handling, you can trigger errors yourself by sending an X-Trigger-Error header with the name of the error. For example, sending a value of APIKeyMissing in the X-Trigger-Error header will trigger a 401 error.