Skip to main content

How do I handle API rate limits and retries when syncing HubSpot or Salesforce data?

Put every write behind a queue, throttle below the vendor’s limit, retry 429 and 5xx errors with exponential backoff, and make every write an upsert keyed on a stable ID so a retry never creates a duplicate. HubSpot allows 190 requests per 10 seconds on Professional private apps; aim for about 150.

What the limits actually are

Limits differ by product, edition and app type, and vendors change them. These are the figures in each vendor’s documentation at the time of writing; check your own account before you size anything. HubSpot publishes its numbers in its API usage guidelines.

System Limit What happens when you hit it
HubSpot, private app, Professional 190 requests per 10 seconds; 650,000 per day HTTP 429; wait out the 10-second window
HubSpot CRM search endpoints 5 requests per second, separate from the burst limit HTTP 429, even when you are well under 190 per 10 seconds
Salesforce, Enterprise Edition 100,000 requests per rolling 24 hours plus 1,000 per user license, shared by every integration in the org REQUEST_LIMIT_EXCEEDED; retrying in seconds does not help
QuickBooks Online About 500 requests per minute per company, 10 concurrent HTTP 429; back off and retry

Two things follow. A burst limit is a speed problem you solve with throttling and backoff. A daily limit is a budget problem: backoff only burns more of it, so the sync has to pause and alert someone.

The four parts of a sync that survives rate limits

1. A queue between read and write

Changes from HubSpot or Salesforce go into a queue (a database table, Amazon SQS, or Redis) instead of being written straight to the other system. The queue is what lets a failure wait instead of disappear. Each item carries the record ID, the payload, an attempt count and a next-try time.

2. A throttle set below the limit

Workers pull from the queue at a fixed rate, roughly 80% of the published limit, so a second integration or a manual import does not push you over. Use batch endpoints where they exist: HubSpot’s batch APIs take up to 100 records per call, which turns 10,000 updates into 100 requests.

3. Exponential backoff with jitter

On a 429, a timeout or a 5xx, wait, then retry, doubling the wait each time, capping it near 60 seconds and adding a random 0–25% so parallel workers do not retry in lockstep. If the response includes a Retry-After header, use it. Do not retry a 400 validation error or a 401: those need a fix or a fresh token, not patience.

4. Idempotent writes

A retry is only safe if sending the same write twice has the same result as sending it once. Use upserts keyed on a stable ID: a Salesforce external ID field, a HubSpot unique property, the requestid parameter in QuickBooks Online, or an Idempotency-Key header in Stripe. Without this, a request that succeeded but timed out on the response becomes a duplicate invoice.

Worked example: HubSpot deals to Postgres and QuickBooks Online

A 60-person company on HubSpot Professional syncs about 2,000 deal changes a day into its internal Postgres database, and creates a QuickBooks Online customer and draft invoice when a deal moves to closed-won.

  1. Every 5 minutes, a job asks HubSpot for deals modified since the last saved timestamp (the watermark), 100 per batch call.
  2. Each change lands in a sync_queue table with status pending and a key of HubSpot deal ID plus modified timestamp, so the same change is never queued twice.
  3. Workers write to Postgres with an upsert on hubspot_deal_id, then call QuickBooks Online at no more than 400 requests per minute, passing requestid set to the queue item’s key.
  4. On success the item becomes done. The watermark advances only when every item in that window is done or parked.

Now the failure. Forty closed-won deals arrive at month-end; QuickBooks Online returns 429 on deal 26. Deals 1–25 are done. Deals 26–40 go back to pending with attempt 1 and a next-try time 2 seconds out.

Attempt Wait before retry Cumulative wait
1 2 s 2 s
2 4 s 6 s
3 8 s 14 s
4 16 s 30 s
5 32 s 62 s
6 60 s (cap) about 2 min

Most items clear by attempt 2 or 3. If deal 26 was actually created before the timeout, the retry with the same requestid returns the original invoice instead of a second one. An item that fails all six attempts moves to failed with the error text, an alert goes to the finance lead, and the other 14 deals carry on. Nothing is lost and nothing is written twice.

Failure modes most teams find the hard way

  • Daily cap exhaustion. A bad loop or a backfill burns the Salesforce daily budget by noon and every other integration in the org stops too. Track usage and pause at 80%.
  • Token expiry. OAuth access tokens expire; a 401 mid-batch should refresh the token once, not trigger backoff.
  • Children before parents. A line item or payment arrives before the deal or customer it belongs to. Park it with a short delay instead of failing it.
  • Upstream field changes. Someone renames a HubSpot property or adds a picklist value; every write fails validation. Retries will not fix it, so alert on the first one.
  • Partial batch success. HubSpot batch calls can return 207 with some records failed; Salesforce composite calls behave similarly with allOrNone off. Requeue only the failures.
  • Search endpoint limits. Teams stay under 190 per 10 seconds and still get 429 from the 5-per-second search limit.

Should you build this or use a no-code tool?

Option Upfront cost What breaks first
Zapier or Make Plan fee only Duplicates on retry, silent failures at volume, no watermark
Off-the-shelf connector Subscription Custom fields and objects it does not map
Custom integration in code $1,500–$6,000 at Smplfy for two systems Needs an owner for upstream changes

Stay on Zapier or Make if you sync under about a thousand records a day, in one direction, and a duplicate is easy to spot and delete. Build in code when money or customer records move, when two systems both write, or when you are already seeing 429 errors. If you have never hit a limit and nobody is cleaning up duplicates, do not hire anyone yet.

We built this pattern for Fundz: a connector framework for HubSpot, Salesforce and Gmail with OAuth, incremental sync, deduplication and rate-limit handling across tenants. Our fixed-price range is $1,500–$6,000 for a two-system sync, or $85 an hour; the top of the range is two-way sync with custom field mapping rules.

Frequently asked questions

What is the HubSpot API rate limit?
For private apps on Professional, HubSpot’s documentation lists 190 requests per 10 seconds and 650,000 per day, with lower limits on Free and Starter and higher on Enterprise. CRM search endpoints have a separate limit of 5 requests per second. Check HubSpot’s API usage guidelines for your account, because the figures change.

How many times should an integration retry a failed API call?
Five or six attempts with exponential backoff, capped around 60 seconds, covers almost all temporary rate-limit and server errors in about two minutes. After that, park the record in a failed list and alert a person. Never retry validation errors, which will fail the same way every time.

How do I stop retries from creating duplicate records?
Make every write idempotent. Use upserts on a stable key such as a Salesforce external ID or a HubSpot unique property, and pass idempotency keys where the API supports them, like QuickBooks Online’s requestid or Stripe’s Idempotency-Key header. A repeated request then updates or returns the original record instead of creating a new one.

What happens if a Salesforce integration hits the daily API limit?
Salesforce returns REQUEST_LIMIT_EXCEEDED and the limit is shared by every integration in the org, so other tools stop too. Backoff does not help because the window is 24 hours. The sync should pause, keep its queue intact and alert someone, then resume when usage drops.

How much does it cost to build a sync with proper retry handling?
At Smplfy, a two-system integration with queuing, backoff, idempotent writes and alerting is typically $1,500–$6,000 fixed price, or $85 an hour. The top of the range is two-way sync with custom field mapping rules. Two to four weeks is typical for a two-system sync.

Related answers

Want a scoped estimate for your sync?

Send us a short description or book a free 20-minute call and we will reply with a written scope. Have ready which systems are involved, roughly how many records change per day, and what someone fixes by hand today. Start a conversation.