# Hubspot API overload during a PATCH call ?

**URL:** <https://community.hubspot.com/t/hubspot-api-overload-during-a-patch-call/110143>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [June 26, 2024, 8:13am UTC](https://community.hubspot.com/t/hubspot-api-overload-during-a-patch-call/110143 "2024-06-26T08:13:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliciaGodefroy](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@AliciaGodefroy](https://community.hubspot.com/u/AliciaGodefroy)\
**Post date:** [June 26, 2024, 8:13am UTC](https://community.hubspot.com/t/hubspot-api-overload-during-a-patch-call/110143/1 "2024-06-26T08:13:27Z")

</div>

Hello,  
We’re encountering a problem in our custom-built application designed to facilitate student enrolment at our school.

We have created a “Lead status” property that should be updated automatically as the student progresses through the process.  
Hubspot support has pointed us to this forum.

When the student is in “Lead status: Invited Interview” and books a meeting slot, his or her status should automatically change to “Booked Interview”.

However, in some cases, we can see on the student’s contact form that the meeting has been scheduled, but the status is still “Invited Interview”.

We think the problem is not due to the code on our side, as we’ve run multiple tests and the triggers for the status change are correct (being in “Invited Interview” && having the hs\_meting\_outcome set to “Scheduled” or “Rescheduled”.

For the students on whom it didn’t work, as soon as they reconnected to their application, their status changed to Booked Interview. This shows that we believe the problem stems from an overload of the Hubspot API at the time of form submission.

Here is some additional information:

**The endpoint used**

define(‘HB\_API1\_PROPS’, ‘/contacts/v1/contact/email/’);

**HubSpot’s raw request to the API**

define(‘HB\_API\_URL’, ‘[https://api.hubapi.com](https://api.hubapi.com)’ );

define(‘HB\_API\_TOKEN’, ‘pat-eu1-3a48423[Information redacted]’ );

define(‘HB\_API\_HEADER’, [“Authorization”=\>"Bearer ".HB\_API\_TOKEN, “Content-Type”=\>“application/json”]);

**And here’s the code that handles the change of status from “Invited Interview” to “Booked Interview”:**

// Change Lead Status to “Booked Interview” under certain conditions (Reminder: Invited Interview is a status to be decided manually by Forward)

if($userProps-\>hs\_lead\_status-\>value == ‘Invited Interview’ && preg\_match(“/(scheduled|rescheduled)/i”, $interviewMeetOutcome) ){

update\_user\_meta($user-\>ID, “hs\_lead\_status$slugHubs”, ‘Booked Interview’);

$argsHubs = array( “body” =\> wp\_json\_encode([“properties”=\>[“hs\_lead\_status”=\> ‘Booked Interview’]]), “method”=\>‘PATCH’, “headers”=\>HB\_API\_HEADER );

wp\_safe\_remote\_post( HB\_API\_URL.HB\_API\_USERS.$userHubsID, $argsHubs );

}  
Do you have any idea where the problem might be coming from?  
Thank you for your help!

---

<div class="post-metadata">

**Author:** ![HubDoPete](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hubdopete/32/106153_2.png) [@HubDoPete](https://community.hubspot.com/u/HubDoPete)\
**Post date:** [June 26, 2024, 1:13pm UTC](https://community.hubspot.com/t/hubspot-api-overload-during-a-patch-call/110143/2 "2024-06-26T13:13:15Z")

</div>

Hi Alicia,

The HubSpot API has a rate limit of a maximum 100 API calls per 10 seconds (per app/key per portal).

It sounds like your app might be occasionally hitting that limit. For example if a Zapier app does this, it reports a “HubSpot Secondly error”

Your custom app is responsible for ensuring no more than 100 API calls per 10 seconds.

Your app should also monitor the HubSpot responses to each API call. A “Success 200” response is great, but “429” errors indicate that the rate limit has been exceeded.

If a 429 is received, your app should back off and retry to complete the sequence.

Our public apps on HubSpot marketplace have had to ensure that no more than 5% of API responses from HubSpot are 429’s. We aim for no more than 1% so that HubSpot does not have to push back.

Is your app logging 429 error responses from HubSpot API for these failed transactions?

If so, you most likely need to implement rate limiting to a max of 100 calls per 10 seconds.

best

Pete
