OAuth, scopes and rate limits
Connection runs through HubSpot’s own OAuth screen: the user reviews the exact scopes, approves there, and HubSpot redirects back with a code the app exchanges for tokens. Scopes are granular, such as crm.objects.contacts.read, and the user sees them before approving.
The access token carries an expires_in of 1800 seconds, currently 30 minutes, and HubSpot expects apps to store the TTL and refresh with the refresh token. A 401 response is not a valid indicator that a refresh is needed; the stored expiry is.
Public apps using OAuth are limited to 110 requests per 10 seconds per installing account, excluding the CRM Search API; the search endpoints have their own limit of five requests per second per account and return no rate-limit headers. Private apps are limited per app to 100 requests per 10 seconds on Free and Starter or 190 on Professional and Enterprise, plus a daily budget of 250,000 to 1,000,000 requests shared across all apps in the account, resetting at midnight in the account’s timezone.
A 429 response names the limit in policyName, DAILY or a per-window policy, and requests that error should stay under 5% of the daily total. Queue bursts so one run does not consume the shared budget.
A created contact is real data in the user’s portal. Keep a run safe to re-execute: search by email before creating, record what was written, and never archive records to hide a duplicate created by a retry.
Sources: Contacts API guide, CRM Search API, API usage guidelines and limits, OAuth quickstart, Associations guide.