OverviewProductsPlatformsAPI ReferenceResources
Connect

Get HubSpot OAuth connect URL

GEThttps://zernio.com/api/v1/connect/hubspot

Initiates OAuth for a HubSpot portal. HubSpot is a connect-only CRM platform: the connected account does not post, read analytics or run ads.

One HubSpot portal can be connected per profile. Connecting a different portal to a profile that already has one redirects with error=hubspot_profile_has_portal.

Authentication

One of these

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

One of these

X-Connect-TokenAPI key in headerRequired

Short-lived connect token for API users during OAuth flows. Automatically generated when initiating OAuth without a browser session. Valid for 15 minutes. Connect tokens are scoped to the intended profile and platform and are accepted only by connection-flow endpoints that explicitly list this security scheme.

Query parameters

profileIdstringRequired

Your Zernio profile ID (get from /v1/profiles).

redirect_urlstring

Custom redirect after connection. Must be an absolute http(s) URL or custom app scheme such as myapp://callback; relative and unsafe URLs return 400.

Responses

Success· the request worked

Errors· the request failed

How it behaves

Flow

  1. Redirect the user to authUrl.
  2. After authorization, HubSpot returns the browser to Zernio's internal callback.
  3. Zernio redirects to redirect_url (or the dashboard when omitted).

On success the redirect carries connected=hubspot, profileId, accountId and username (the portal domain). On failure it carries error, platform=hubspot and error_message.

Reconnecting the same portal and profile updates the stored connection in place and keeps its settings.

Requested scopes: oauth, crm.objects.contacts.read, crm.objects.contacts.write.

GET/v1/connect/hubspot
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.getHubSpotConnectUrl({  query: {    profileId: 'profile_abc123',  },});console.log(data);
{  "authUrl": "http://example.com",  "state": "string"}
OpenAPI specification
Was this page helpful?