Title: A HTTP error occurred when validating the API. Error code: 502 Bad Gateway
Last modified: August 22, 2016

---

# A HTTP error occurred when validating the API. Error code: 502 Bad Gateway

 *  Resolved [brhalltx](https://wordpress.org/support/users/brhalltx/)
 * (@brhalltx)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/a-http-error-occurred-when-validating-the-api-error-code-502-bad-gateway/)
 * I’m getting a 502 error when trying to verify the Mailgun API key.
    I have the
   current version of the plugin. I have a Mailgun API key. I’m using the public
   key. It won’t validate. I’ve tried the other key; it won’t validate. I’ve removed
   the “pubkey-“; it still won’t validate. I know the API key works. Is there a 
   fix for this? Thanks!
 * [https://wordpress.org/plugins/mailgun-email-validator/](https://wordpress.org/plugins/mailgun-email-validator/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/a-http-error-occurred-when-validating-the-api-error-code-502-bad-gateway/#post-5402021)
 * Thanks for notifying about this issue.
 * The API key verification form sent a HTTP HEAD request to Mailgun’s URL. However
   they have stopped accepting HEAD requests which caused the 502 error.
 * Version 1.2.1 of this plugin uses GET method to validate the API key.
 * **This issue does not impact email validation in any way and you can still validate
   email addresses whether you update to this release or not.**

Viewing 1 replies (of 1 total)

The topic ‘A HTTP error occurred when validating the API. Error code: 502 Bad Gateway’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mailgun-email-validator_777777.svg)
 * [Mailgun Email Validator](https://wordpress.org/plugins/mailgun-email-validator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailgun-email-validator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailgun-email-validator/)
 * [Active Topics](https://wordpress.org/support/plugin/mailgun-email-validator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailgun-email-validator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jesin A](https://wordpress.org/support/users/jesin/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/a-http-error-occurred-when-validating-the-api-error-code-502-bad-gateway/#post-5402021)
 * Status: resolved