# 502 errors Bad Gateway

**URL:** <https://community.hubspot.com/t/502-errors-bad-gateway/75934>\
**Category:** APIs & Integrations\
**Tags:** php, professional\
**Created:** [February 24, 2023, 2:04pm UTC](https://community.hubspot.com/t/502-errors-bad-gateway/75934 "2023-02-24T14:04:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BDubois](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@BDubois](https://community.hubspot.com/u/BDubois)\
**Post date:** [February 24, 2023, 2:04pm UTC](https://community.hubspot.com/t/502-errors-bad-gateway/75934/1 "2023-02-24T14:04:06Z")

</div>

Hello,  
Since yesterday we experiment random 502 errors on PATCH [https://api.hubapi.com/crm/v3/objects/companies/](https://api.hubapi.com/crm/v3/objects/companies/) endpoints but also on SearchApi.  
We got an html page from Cloudflare when it happends.  
I saw Cloudflare ran into some issues recently, can you confirm it please ?

---

<div class="post-metadata">

**Author:** ![PamCotton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pamcotton/32/47916_2.png) [@PamCotton](https://community.hubspot.com/u/PamCotton)\
**Post date:** [February 24, 2023, 10:00pm UTC](https://community.hubspot.com/t/502-errors-bad-gateway/75934/2 "2023-02-24T22:00:12Z")

</div>

Hello @BDubois, thank you for posting in our Community!

You will normally only see 502 responses when making a large number of requests over a sustained period. If you get one of these responses, you should pause your requests for a few seconds, then retry.

Let me know if that works for you.

Kindly,

Pam

---

<div class="post-metadata">

**Author:** ![BDubois](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@BDubois](https://community.hubspot.com/u/BDubois)\
**Post date:** [February 27, 2023, 9:13am UTC](https://community.hubspot.com/t/502-errors-bad-gateway/75934/3 "2023-02-27T09:13:16Z")

</div>

Hello @PamCotton ,  
Thank you for your reply.  
We are currently in huge process of migration datas from previous CMR and cleaning the current datas in Hubspot.  
So we make a lot of requests, and we only experimented 502 errors since Friday, this is why I wondered.  
But thanksfully there is an retry logic with the PHP client library, so implemented it already and it seems going fine now 👍.
