Skip to content
hubspot logo

HubSpot Skill

hubspot

HubSpot CRM and CMS API integration for contacts, companies, deals, owners, and content management.

SKILL.md

Full skill instructions

HubSpot Skill

Interact with HubSpot CRM and CMS via the REST API.

Setup

Set your HubSpot Private App access token:

HUBSPOT_ACCESS_TOKEN=pat-na2-xxxxx

API Base

All endpoints use: https://api.hubapi.com

Authorization header: Bearer $HUBSPOT_ACCESS_TOKEN


CRM Objects

Contacts

Create contact:

curl -s -X POST -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"properties":{"email":"[email protected]","firstname":"Test","lastname":"User","phone":"555-1234","company":"Acme Inc","jobtitle":"Manager"}}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts" | jq

List contacts:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts?limit=10" | jq

Search contacts:

curl -s -X POST -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"filterGroups":[{"filters":[{"propertyName":"email","operator":"CONTAINS_TOKEN","value":"example.com"}]}],"limit":10}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts/​search" | jq

Get contact by ID:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts/​{contactId}?properties=email,firstname,lastname,phone,company" | jq

Get contact by email:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts/​{email}?idProperty=email" | jq

Companies

List companies:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​companies?limit=10&properties=name,domain,industry" | jq

Search companies:

curl -s -X POST -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"filterGroups":[{"filters":[{"propertyName":"name","operator":"CONTAINS_TOKEN","value":"acme"}]}],"limit":10}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​companies/​search" | jq

Get company by ID:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​companies/​{companyId}?properties=name,domain,industry,numberofemployees" | jq

Deals

Create deal:

curl -s -X POST -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"properties":{"dealname":"New Deal","amount":"10000","closedate":"2026-06-01","description":"Deal notes here"}}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​deals" | jq

List deals:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​deals?limit=10&properties=dealname,amount,dealstage,closedate" | jq

Search deals:

curl -s -X POST -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"filterGroups":[{"filters":[{"propertyName":"dealstage","operator":"EQ","value":"closedwon"}]}],"limit":10}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​deals/​search" | jq

Get deal by ID:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​objects/​deals/​{dealId}?properties=dealname,amount,dealstage,closedate,pipeline" | jq

Owners

List owners (users):

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​owners" | jq

Update & Assign Owner

Update contact properties:

curl -s -X PATCH -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"properties":{"phone":"555-9999","jobtitle":"Director"}}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts/​{contactId}" | jq

Assign owner to contact:

curl -s -X PATCH -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"properties":{"hubspot_owner_id":"{ownerId}"}}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​contacts/​{contactId}" | jq

Assign owner to deal:

curl -s -X PATCH -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"properties":{"hubspot_owner_id":"{ownerId}"}}' \
  "https://api.hubapi.com/​crm/​v3/​objects/​deals/​{dealId}" | jq

Associations

Get associated contacts for a company:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v4/​objects/​companies/​{companyId}/​associations/​contacts" | jq

Get associated deals for a contact:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v4/​objects/​contacts/​{contactId}/​associations/​deals" | jq

Create association (deal to contact):

curl -s -X POST -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  -H "Content-Type: application/​json" \
  -d '{"inputs":[{"from":{"id":"{dealId}"},"to":{"id":"{contactId}"},"types":[{"associationCategory":"HUBSPOT_DEFINED","associationTypeId":3}]}]}' \
  "https://api.hubapi.com/​crm/​v4/​associations/​deals/​contacts/​batch/​create" | jq

Common association type IDs:

  • 3: Deal to Contact
  • 5: Deal to Company
  • 1: Contact to Company

Properties (Schema)

List contact properties:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​properties/​contacts" | jq '.results[].name'

List company properties:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​properties/​companies" | jq '.results[].name'

List deal properties:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​crm/​v3/​properties/​deals" | jq '.results[].name'

CMS

Pages

List site pages:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​cms/​v3/​pages/​site-pages?limit=10" | jq

List landing pages:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​cms/​v3/​pages/​landing-pages?limit=10" | jq

Domains

List domains:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​cms/​v3/​domains" | jq

Files

List files:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​files/​v3/​files?limit=10" | jq

Search files:

curl -s -H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
  "https://api.hubapi.com/​files/​v3/​files/​search?name=logo" | jq

Search Operators

For search endpoints, use these operators in filters:

OperatorDescription
EQEqual to
NEQNot equal to
LTLess than
LTELess than or equal
GTGreater than
GTEGreater than or equal
CONTAINS_TOKENContains word
NOT_CONTAINS_TOKENDoes not contain word
HAS_PROPERTYHas a value
NOT_HAS_PROPERTYDoes not have a value

PowerShell Examples

For Windows/​PowerShell, use Invoke-RestMethod:

$headers = @{ 
  "Authorization" = "Bearer $env:HUBSPOT_ACCESS_TOKEN"
  "Content-Type" = "application/​json" 
}

# List contacts
Invoke-RestMethod -Uri "https://api.hubapi.com/​crm/​v3/​objects/​contacts?limit=10" -Headers $headers

# Search contacts
$body = @{
  filterGroups = @(@{
    filters = @(@{
      propertyName = "email"
      operator = "CONTAINS_TOKEN"
      value = "example.com"
    })
  })
  limit = 10
} | ConvertTo-Json -Depth 5

Invoke-RestMethod -Method POST -Uri "https://api.hubapi.com/​crm/​v3/​objects/​contacts/​search" -Headers $headers -Body $body

Notes

  • Full CRUD operations supported with appropriate scopes
  • Rate limits: 100 requests per 10 seconds for private apps
  • Pagination: Use after parameter from paging.next.after for next page
  • Portal ID is in the record URL: https://app-na2.hubspot.com/​contacts/​{portalId}/​record/​...

More Sales & marketing skills

revops logo
Sales & marketing

revops

Design and optimize systems connecting marketing, sales, and customer success into a unified revenue engine.

53.3K 104.9K
View
lead-magnets logo
Sales & marketing

lead-magnets

Strategic planning and optimization for email capture offers and gated content.

53.3K 103.4K
View
directory-submissions logo
Sales & marketing

directory-submissions

Directory submissions: the foundation layer of distribution that passes backlinks and discovery surface area into your marketing pages.

53.3K 76.3K
View
gsap-timeline logo
Sales & marketing

gsap-timeline

Sequence and choreograph multi-step animations with precise timing control and nested timelines.

15.9K 58.4K
View
launch-strategy logo
Sales & marketing

launch-strategy

Structured framework for planning product launches, feature announcements, and go-to-market strategies.

53.3K 56.8K
View
gws-drive-upload logo
Sales & marketing

gws-drive-upload

Upload files to Google Drive with automatic MIME type detection and metadata.

31.2K 47.2K
View
ci-cd-and-automation logo
Sales & marketing

ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

101.4K 43.2K
View
persona-team-lead logo
Sales & marketing

persona-team-lead

Team leadership persona with standup coordination, meeting prep, task delegation, and team communication.

31.2K 29.3K
View
recipe-find-large-files logo
Sales & marketing

recipe-find-large-files

Identify large Google Drive files consuming storage quota.

31.2K 29.2K
View

Sales & marketing AI tools

KreadoAI logo
Sales & marketing

KreadoAI

Revolutionize Video Creation with AI-Generated Avatars and Voices

Paid
View
Followr logo
Sales & marketing

Followr

Social media on autopilot

Paid
View
Logodiffusion logo
Sales & marketing

Logodiffusion

Design custom logos instantly with AI.

Paid
View
I
Sales & marketing

Ideogram

Text-heavy marketing and design images

Freemium
View
Prompt Silo logo
Sales & marketing

Prompt Silo

Boost Your SEO with Content and SEO Silos

Free
View
Marketing Blocks logo
Sales & marketing

Marketing Blocks

Revolutionize Your Marketing with AI-Powered MarketingBlocks!

Paid
View
Scrip AI logo
Sales & marketing

Scrip AI

10X faster & free AI content creation for 100+ use cases

Free
View
Tribescaler logo
Sales & marketing

Tribescaler

Tribescaler | Make Your Tweets Go Viral

Paid
View