Title: Error posting to API
Last modified: July 1, 2020

---

# Error posting to API

 *  Resolved [moisture9063](https://wordpress.org/support/users/ngrhd/)
 * (@ngrhd)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/)
 * Hello!
 * For sometime I’m unable to process images using Smush. This is what I receive
 * > Error posting to API: 502 Bad Gateway
 * Screenshot: [https://imgur.com/a/pZDRjMi](https://imgur.com/a/pZDRjMi)
 * What could be the issue?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Anton Vanyukov](https://wordpress.org/support/users/vanyukov/)
 * (@vanyukov)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/#post-13061155)
 * [@ngrhd](https://wordpress.org/support/users/ngrhd/),
 * Could you please share a link to the image you are not able to optimize?
 * Best regards,
    Anton
 *  [Dienies](https://wordpress.org/support/users/dienies/)
 * (@dienies)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/#post-13061642)
 * Hi, I have the exact same problem. Wanted to create a new ticket here but saw
   this issue on top of the forum list.
 * Some images also have the error: Couldn’t process image due to bad headers. Try
   re-saving the image in an image editor, then upload it again. I am fine reloading
   it, but how can I prevent a “bad image header”in future?
 * I did however, started to smush images one by one in media library, and sometimes
   they were in process for couple of hours…so I would ”ignore’ the process and 
   then click undo, and start over again. But some would finish at all, they just
   keep processing for hours… I only saw later that one can bulk process images 
   on smush settings page (my bad).
 * Site is still under construction though, but I can make a plan to share image
   links?
    Thanks in advance
    -  This reply was modified 5 years, 11 months ago by [Dienies](https://wordpress.org/support/users/dienies/).
 *  Thread Starter [moisture9063](https://wordpress.org/support/users/ngrhd/)
 * (@ngrhd)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/#post-13062007)
 * Hello [@vanyukov](https://wordpress.org/support/users/vanyukov/)
 * [Here’s](https://shreejee.co/wp-content/uploads/2020/07/transformer-header-comp-scaled.jpg)
   the link to the image , that I’m unable to Smush.
 * Regards
 *  [Anton Vanyukov](https://wordpress.org/support/users/vanyukov/)
 * (@vanyukov)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/#post-13070233)
 * [@ngrhd](https://wordpress.org/support/users/ngrhd/),
 * I have checked the image that you’ve linked. It was compressed for me without
   any issues. Can you please try again and see if it is working for you now?
 * 502 errors usually happen when there are some communication issues between the
   site and API. Could be there was a connection glitch.
 * Best regards,
    Anton
 *  [Predrag – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support1/)
 * (@wpmudev-support1)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/#post-13381372)
 * Hello, hope you’re doing well!
 * We haven’t heard back from you for a while now so we’ve marked this ticket as
   resolved. If you do have any followup questions or require further assistance
   feel free to reopen it and let us know here.
 * Cheers,
    Predrag

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error posting to API’ is closed to new replies.

 * ![](https://ps.w.org/wp-smushit/assets/icon-256x256.gif?rev=3447113)
 * [Smush – Image Optimization, Compression, Lazy Load, WebP & CDN](https://wordpress.org/plugins/wp-smushit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-smushit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-smushit/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-smushit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-smushit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-smushit/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Predrag – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support1/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/error-posting-to-api-3/#post-13381372)
 * Status: resolved