Guides / n8n × HubSpot / Authentication

Fix "missing scopes" errors on a HubSpot private app

Diagnose HubSpot private-app scope errors by mapping endpoints, app permissions, account access, and token lifecycle.

Advertisement
Short answer: Identify the exact endpoint and operation, read its current required-scope documentation, add the minimum scope to the private app, save the change, and verify whether the token must be regenerated or reauthorized. Test the same account, object, and operation after the change. Keep scope configuration under change control.

Map operation to scope

Create a table for every API action:

Do not guess a scope from the object name. HubSpot has separate permissions for objects and some account features. Read the endpoint reference for the version you call.

OperationObjectRead/writeRequired scopeTested
List contactsContactsReadCurrent contacts read scopeYes
Update dealDealsWriteCurrent deals write scopePending
Create associationCRM associationWriteCurrent association scopePending

Why the old token still fails

A private app’s scope configuration and the token used by your process can be out of sync. After changing permissions, inspect the app and token state, then restart workers that cache credentials. If the integration uses OAuth rather than a private app, the user or customer may need to reauthorize so the new grant is issued.

Do not paste a new token into one workflow node and assume the rest of the deployment uses it. Centralize credentials and deploy configuration consistently.

Advertisement

Account and object access

Scopes are not the entire permission model. The app must belong to or be authorized for the correct HubSpot account, and the record may be inaccessible because of object rules or account configuration. Confirm account ID, app identity, object type, record ID, and operation.

Test with a known harmless record. A successful list call does not prove a write is permitted.

Inspect the final request

Log method, path, account context, status, scope alias, and a redacted response. Never log the Bearer token. Confirm that the connector did not send a different token, append hapikey, or call an outdated endpoint.

An example request is:

PATCH https://api.hubapi.com/crm/v3/objects/deals/123
Authorization: Bearer PRIVATE_APP_TOKEN
Content-Type: application/json

Avoid over-granting

Grant the smallest scope set that completes the workflow. A token that can read and write every CRM object has a larger blast radius than a reporting token with read-only access. Separate import, reporting, and admin credentials where practical.

Review scopes when features change. Remove unused scopes after testing a smaller configuration.

Bulk jobs and partial failure

If a bulk import fails for missing scopes, do not blindly retry every row. Correct the app configuration, test one row, then replay only failed rows using an idempotent operation. Keep source row number and external ID in the failure report.

One workflow may call several objects. Verify the complete chain, including associations, not only the first request.

Operational checklist

Confirm endpoint version, required scope, private app identity, account, token source, worker restart, record access, and final response. Add a deployment test that performs one safe read and one controlled write. Alert on new 403 responses rather than retrying them indefinitely.

The trap: adding every available scope. It may hide the immediate error while creating an unnecessarily powerful credential that is harder to audit.

Build a scope test matrix

For each workflow, list the exact route, HTTP method, object, account, and expected permission. Run the matrix with the replacement token and record the result. Include a harmless read, a controlled create or update, an association call, and an intentionally forbidden operation.

If the app configuration changes, restart long-lived workers, clear credential caches, and confirm the credential alias in logs. For a multi-account system, check that the token belongs to the account named in the connection record.

Separate missing scope from object-level access. A token can have a broad API scope while the user or account still lacks access to a specific record or feature. A 403 response should lead to an account and permission review, not endless retries.

Keep a dead-letter queue for failed writes. Store source row, object ID, operation, scope alias, status, and a redacted error. Once the scope is corrected, replay only safe and idempotent operations.

Least-privilege maintenance

Review scopes quarterly and after every new endpoint. Remove permissions that the integration no longer uses, then run the test matrix again.

Scope changes and production rollout

Treat a scope change like a deployment. Open a change record with the endpoint, reason, requested scope, account owner, reviewer, and rollback action. Add the permission in a development account first and run the exact client version that production uses. A manual call made by an administrator can succeed while the deployed token still fails.

After saving the private-app configuration, restart workers that cache the token and run a safe read. Then run one controlled write against a test record. Confirm the final object and any association, not only the HTTP status. If the scope is still missing, verify that the process is not loading an older secret from a second environment variable or connector credential.

For multiple accounts, store scopes and token aliases per connection. One customer may approve a broader integration than another. Mark a connection as partially configured when it lacks an optional scope, and disable only the feature that needs it instead of disabling every workflow.

Avoid repeated retries for 403 responses. Queue the operation, tell the owner which permission is missing, and replay it only after the configuration has been verified.

Keep an approval record for every scope change and review it with the account owner. The record should name the endpoint that required the change, the old and new scope sets, the test account, the worker restart time, the test result, and the deployment time. Keep the final approval with the account administrator. A compact, specific record creates a repeatable audit trail and shortens future incident response without storing the token itself.

When an optional feature is unavailable, expose that state to operators instead of presenting a generic authentication failure. For example, a connection may be healthy for contact reads but not authorized for a deal association. Showing the affected capability makes the smallest safe remediation obvious and avoids granting broad permissions simply to silence one error.

Make the error actionable in a connector

Return the affected capability, endpoint, required scope, account alias, and reconnect or admin action. “Missing scopes” is too broad when a connection can still perform safe reads. A feature-level status lets an operator pause only the blocked operation, approve the smallest permission change, and replay queued writes after verification rather than disabling the whole integration.

Where these facts come from

Advertisement
Advertisement