Learn how to handle common API errors when developing with HubSpot’s APIs.
200
OK response upon success. Any endpoints returning a different status code will specify the returned response in its documentation.
Error | Details |
---|---|
207 Multi-Status | Returned when there are different statuses (e.g., errors and successes), which occurs when you’ve enabled multi-status error handling for the object API batch create endpoints. |
401 Unauthorized | Returned when the authentication provided is invalid. See the authentication overview for details on authenticating API requests. |
403 Forbidden | Returned when the authentication provided does not have the proper permissions to access the specific URL. For example, an OAuth token that only has the content scope authorized would get a 403 when attempting to retrieve records from the Deals API (which requires the crm.objects.deals.read scope). If you’ve confirmed that your app has the necessary scopes, please reach out to HubSpot support for assistance. |
423 Locked | Returned when attempting to sync a large volume of data (e.g., upserting thousands of company records in a very short period of time). Locks will last for 2 seconds, so if you receive a 423 error, you should include a delay of at least 2 seconds between your API requests. |
429 Too many requests | Returned when your account or app is over its API rate limits. Find suggestions on working within those limits here. |
477 Migration in Progress | Returned when a HubSpot account is currently being migrated between data hosting locations. HubSpot will return a Retry-After response header indicating how many seconds to wait before retrying the request (typically up to 24 hours). |
502/504 timeouts | Returned when HubSpot’s processing limits have been met. These limits are in place to prevent a single client from causing degraded performance. These timeout responses occur 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. |
503 service temporarily unavailable | Returned when HubSpot is temporarily unavailable. If you receive this response, you should pause your requests for a few seconds, then retry. |
521 web server is down | Returned when HubSpot’s server is down, this should be a temporary issue. If you receive this response, you should pause your requests for a few seconds, then retry. |
522 connection timed out | Returned when the connection between HubSpot and your application has timed out. If you’ve received this response, please reach out to HubSpot support for assistance. |
523 origin is unreachable | Returned when HubSpot is unable to contact your application. If you receive this response, you should pause your requests for a few seconds, then retry. |
524 timeout | Returned when a response is not received within 100 seconds. This can occur when the HubSpot’s server is overloaded, such as with a large data query. If you receive this response, you should pause your requests for a few seconds, then retry. |
525/526 SSL issues | Returned when the SSL certificate is invalid or the SSL handshake fails. If you’ve received this response, please reach out to HubSpot support for assistance. |
message
, code
, and context
fields, which will provide additional information on required properties that were not included in your request, as well as any issues with malformed properties in your request.objectWriteTraceId
value for each input in your request. The objectWriteTraceId
can be any unique string.
For example, a request to create tickets could look like:
4xx
or 5xx
)Retry-After
header if present. Note that the Retry-After
value is in miliseconds.
Notifications will be retried up to 10 times. These retries will be spread out over the next 24 hours, with varying delays between requests. Individual notifications will have some randomization applied, to prevent a large number of concurrent failures from being retried at the exact same time.
429
or 5XX
error from axios
or @hubspot/api-client
, HubSpot will reattempt to execute your action for up to three days, starting one minute after failure. Subsequent failures will be retried at increasing intervals, with a maximum gap of eight hours between tries.