Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt

Use this file to discover all available pages before exploring further.

HubSpot The HubSpot app provides read/write access to a HubSpot portal through the HubSpot REST API. It can be used either as a Builder app (automations call HubSpot instructions directly) or as a remote MCP server consumed by an AI agent. Each tenant authenticates either with a Private App token (PAT) — shared across all users of the tenant — or via per-user OAuth 2.0 (authorization-code with PKCE). The connector exposes ~120 operations grouped into 18 entity tools covering the CRM (contacts, companies, deals, tickets, engagements, associations, pipelines, properties, owners, lists) and the Marketing layer (forms, marketing emails, workflows, files).

CRM Records

Contacts, companies, deals and tickets with list/search/get/create/update/archive plus batch and merge operations

Engagements & Pipelines

Notes, tasks, calls, emails and meetings; pipelines and stages; properties and property groups; owners and lists

Marketing

Forms, transactional and marketing emails, workflows enrollment, and the Files Manager

Prerequisites

  • A HubSpot account with access to the portal you want to expose, and an admin who can create Private Apps or OAuth applications.
  • One of:
    • A Private App token (PAT) — created at Settings → Integrations → Private Apps (https://app.hubspot.com/private-apps/<portal-id>). Quickest setup, shared across all users of this tenant.
    • A HubSpot OAuth Application — created at app.hubspot.com/l/developer (Developer account → Create appAuth). The Redirect URI must match the value shown in the OAuth Callback URL field of the installed app instance (auto-populated on install — copy it back into the HubSpot developer console after installation). Per-user authorization; ideal when actions must be attributed to the end-user.
  • Whichever auth method you choose, make sure the selected scopes cover the resources you intend to read/write (crm.objects.contacts.*, crm.objects.companies.*, tickets, content, automation, forms, files, etc.).
  • Base URL (default: https://api.hubapi.com)
HubSpot has no standard RFC 7009 revocation endpoint. The disconnect tool deletes the platform-stored tokens but cannot revoke them at HubSpot — refresh tokens may still be valid until they naturally expire (typically 6 months idle).

Installation

  1. Go to Apps in your workspace
  2. Search for HubSpot and install it
  3. Open the app instance configuration and fill in either the PAT or the OAuth client credentials

Configuration

FieldDescription
HubSpot API Base URLBase URL of the HubSpot API (default https://api.hubapi.com)
HubSpot Private App Token (PAT)Private App access token. Optional when using OAuth. Stored as a workspace secret
OAuth2 Client IDHubSpot OAuth Application Client ID, stored as a workspace secret
OAuth2 Client SecretHubSpot OAuth Application Client Secret, stored as a workspace secret
OAuth Callback URLAuto-populated on install — paste this value into the Redirect URI field of your HubSpot OAuth app
OAuth Authorize URLDefault https://app.hubspot.com/oauth/authorize
OAuth Token URLDefault https://api.hubapi.com/oauth/v1/token
OAuth Revoke URLHubSpot does not expose RFC 7009 revocation. Leave empty
OAuth ScopesSpace-separated HubSpot scopes. Default covers CRM + Marketing read/write. See HubSpot OAuth scopes
Refresh Token TTL (seconds)How long the refresh token is kept in user-scoped secrets. Default 7200 (2h)
MCP EndpointAuto-populated on install — URL of the MCP endpoint for this instance
MCP API KeyAuto-populated on install — signed key used in the mcp-api-key header. Do not modify
MCP Endpoint, MCP API Key and OAuth Callback URL are generated automatically by the onInstall flow. Either fill in the PAT or the OAuth credentials — if both are present, the per-user OAuth session takes precedence and the PAT is used only as a fallback.

Authorize end-users (OAuth mode)

When the tenant uses OAuth, each end-user authorizes their own HubSpot account through a browser-based consent screen:
1

Trigger the connect flow

From an MCP client (Agent Creator capability or any tool client), call any data tool. If no OAuth session exists for the current user × tenant, the MCP server returns a connector_auth_required payload with a connect_url. Alternatively, call the connect tool explicitly.
2

Open the connect URL

Open the returned URL in a browser tab where the user is already authenticated to Prisme.ai. The platform redirects to the HubSpot consent screen.
3

Grant access

The user reviews the requested scopes and clicks Connect app. HubSpot redirects back to the platform’s oauthCallback webhook.
4

Confirmation

The user sees a Connection complete page and can close the tab. The platform has stored an access token plus refresh token as user-scoped secrets — both are tenant-prefixed so they do not leak across app instances.
Each user’s OAuth tokens are scoped per (user × tenant). A user who has authorized in tenant A does not gain access in tenant B — they must run the connect flow again per app instance.

Available Instructions

Every instruction resolves credentials from the workspace configuration. CRM list operations accept limit (default 100) and after for cursor pagination, plus properties to request specific fields. Most CRM tools accept an optional objectType to override the default object type — useful for custom objects.

Contacts

InstructionArguments
listContactslimit, after, properties, propertiesWithHistory, associations, archived
getContactcontactId*, properties, propertiesWithHistory, associations, archived, idProperty
createContactproperties*, associations
updateContactcontactId, properties, idProperty
archiveContactcontactId*
searchContactsfilterGroups, sorts, query, properties, limit, after
mergeContactsprimaryObjectId, objectIdToMerge
batchReadContactsinputs*, properties, propertiesWithHistory, idProperty
batchCreateContactsinputs*
batchUpdateContactsinputs*
batchArchiveContactsinputs*

Companies

Same shape as contacts: listCompanies, getCompany, createCompany, updateCompany, archiveCompany, searchCompanies, mergeCompanies, batchReadCompanies, batchCreateCompanies, batchUpdateCompanies, batchArchiveCompanies.

Deals

Same shape as contacts: listDeals, getDeal, createDeal, updateDeal, archiveDeal, searchDeals, mergeDeals, batchReadDeals, batchCreateDeals, batchUpdateDeals, batchArchiveDeals.

Tickets

listTickets, getTicket, createTicket, updateTicket, archiveTicket, searchTickets, batchReadTickets, batchCreateTickets, batchUpdateTickets, batchArchiveTickets (no merge).

Associations

InstructionArguments
listAssociationsfromObjectType, fromObjectId, toObjectType*, after, limit
createAssociationfromObjectType, fromObjectId, toObjectType, toObjectId, associationCategory, associationTypeId
archiveAssociationfromObjectType, fromObjectId, toObjectType, toObjectId

Engagements

Notes, tasks, calls, emails and meetings share the same shape: list, get, create, update, archive.
InstructionArguments
listNotes / listTasks / listCalls / listEmails / listMeetingslimit, after, properties, associations, archived
getNote / getTask / getCall / getEmail / getMeetingengagementId*, properties, associations, archived
createNote / createTask / createCall / createEmail / createMeetingproperties*, associations
updateNote / updateTask / updateCall / updateEmail / updateMeetingengagementId, properties
archiveNote / archiveTask / archiveCall / archiveEmail / archiveMeetingengagementId*

Pipelines

InstructionArguments
listPipelinesobjectType*
getPipelineobjectType, pipelineId
createPipelineobjectType, label, stages*, displayOrder
updatePipelineobjectType, pipelineId, label, stages, displayOrder
archivePipelineobjectType, pipelineId
listPipelineStagesobjectType, pipelineId
getPipelineStageobjectType, pipelineId, stageId*
createPipelineStageobjectType, pipelineId, label*, metadata, displayOrder
updatePipelineStageobjectType, pipelineId, stageId*, label, metadata, displayOrder
archivePipelineStageobjectType, pipelineId, stageId*

Properties

listProperties, getProperty, createProperty, updateProperty, archiveProperty, listPropertyGroups, createPropertyGroup, updatePropertyGroup, archivePropertyGroup.

Owners

InstructionArguments
listOwnersemail, after, limit, archived
getOwnerownerId*, idProperty

Lists

InstructionArguments
createListname, objectTypeId, processingType*, filterBranch
getListlistId*, includeFilters
updateListlistId*, name
deleteListlistId*
searchListsquery, count, offset, processingTypes, additionalProperties
addMemberslistId, recordIds
removeMemberslistId, recordIds
getMembershipslistId*, after, limit

Forms

InstructionArguments
listFormsafter, limit, archived, formTypes
getFormformId*, archived
createFormname, formType, fieldGroups, configuration
updateFormformId*, name, fieldGroups, configuration
archiveFormformId*
submitFormportalId, formGuid, fields*, context, legalConsentOptions

Marketing Emails

InstructionArguments
listMarketingEmailsafter, limit, archived, sort, name
getMarketingEmailemailId*
createMarketingEmailname*, subject, subscription, content
updateMarketingEmailemailId*, name, subject, subscription, content
archiveMarketingEmailemailId*
sendTransactionalemailId, message, contactProperties, customProperties

Workflows

InstructionArguments
listWorkflowslimit, offset
getWorkflowworkflowId*
enrollContactInWorkflowworkflowId, email
unenrollContactFromWorkflowworkflowId, email

Files

InstructionArguments
listFilesafter, limit, parentFolderId, parentFolderPath, name, extension
getFilefileId*
getSignedUrlfileId*, expirationSeconds, upscale
archiveFilefileId*
importFromUrlname, url, folderId, folderPath, access, duplicateValidationStrategy
listFoldersafter, limit, parentFolderId, name
createFoldername*, parentFolderId, parentPath
archiveFolderfolderId*
Arguments flagged with * are required.

DSUL Examples

Look up a contact by email

- Hubspot.contacts:
    action: search
    filterGroups:
      - filters:
          - propertyName: email
            operator: EQ
            value: '{{lead.email}}'
    properties:
      - email
      - firstname
      - lastname
      - lifecyclestage
    limit: 1
    output: matched

Create a deal and associate it to a company

- Hubspot.deals:
    action: create
    properties:
      dealname: '{{opportunity.name}}'
      amount: '{{opportunity.amount}}'
      dealstage: 'appointmentscheduled'
      pipeline: 'default'
      closedate: '{{opportunity.closeDate}}'
    associations:
      - to:
          id: '{{companyId}}'
        types:
          - associationCategory: HUBSPOT_DEFINED
            associationTypeId: 5
    output: created

Add a contact to a static list

- Hubspot.lists:
    action: addMembers
    listId: '{{leadsListId}}'
    recordIds:
      - '{{contactId}}'

Send a transactional email

- Hubspot.marketingEmails:
    action: sendTransactional
    emailId: '{{templateId}}'
    message:
      to: '{{lead.email}}'
      from: 'noreply@acme.com'
    contactProperties:
      firstname: '{{lead.firstName}}'
    customProperties:
      orderId: '{{order.id}}'
      orderTotal: '{{order.total}}'

Bulk-import contacts

- Hubspot.contacts:
    action: batchCreate
    inputs:
      - properties:
          email: 'alice@acme.com'
          firstname: 'Alice'
          lastname: 'Doe'
      - properties:
          email: 'bob@acme.com'
          firstname: 'Bob'
          lastname: 'Smith'
    output: batchResult

Error Handling

HTTP StatusMeaningTypical Cause
400Bad RequestInvalid property value, malformed filterGroups, missing required field
401UnauthorizedMissing / invalid PAT or OAuth token, revoked refresh token
403ForbiddenThe token does not include the required scope, or the user/portal does not have the feature enabled (Marketing Hub Pro+, etc.)
404Not FoundRecord / list / workflow / form does not exist (or was archived)
409ConflictUnique-property collision (e.g. contact with the same email already exists)
429Rate LimitedPer-portal quota exceeded — back off based on the X-HubSpot-RateLimit-Secondly-Remaining headers
500 / 502 / 503Server ErrorTransient HubSpot API error — retry with exponential backoff

Common Issues

“Not configured” — The app instance has neither a PAT nor OAuth credentials. Provide at least one. “Invalid API key” (MCP) — The mcp-api-key header does not match the central app secret. Reinstall the app instance to regenerate a signed key. “Credentials lookup failed” — The MCP endpoint could not reach the getConfig webhook of the installed app. Verify that the app instance is still installed in the expected workspace. connector_auth_required (OAuth tenants only) — The calling user has no HubSpot OAuth session yet for this tenant. The response payload includes a connect_url; relay it to the user so they can authorize their HubSpot account. redirect_uri_mismatch during the OAuth dance — The value of OAuth Callback URL in the app config has not been added to the Redirect URLs of your HubSpot OAuth application. Copy it back and retry. MISSING_SCOPES (403) — The PAT or OAuth token does not include the scopes required by the operation. Edit the Private App / OAuth scopes in the HubSpot UI and reinstall the app instance. OBJECT_ALREADY_EXISTS on contact create — A contact with the same email already exists. Either update the existing contact (use email as idProperty) or query first with search. Lists API: cannot add members to a dynamic list — Only static / MANUAL lists accept addMembers and removeMembers. Dynamic lists are managed by their filter criteria.

External Resources

HubSpot Developer Docs

Official HubSpot REST API reference

Tool Agents

Build AI agents that call MCP tools dynamically