Maton

HubSpot

Access the HubSpot CRM API with managed OAuth authentication. Create and manage contacts, companies, deals, and their associations.

Reference

List Contacts

GET /hubspot/crm/v3/objects/contacts?limit=100&properties=email,firstname,lastname,phone
maton hubspot contact list --properties email,firstname,lastname,phone -L 100

Get Contact

GET /hubspot/crm/v3/objects/contacts/{contactId}?properties=email,firstname,lastname
maton hubspot contact view <contactId> --properties email,firstname,lastname

Create Contact

POST /hubspot/crm/v3/objects/contacts
Content-Type: application/json

{
  "properties": {
    "email": "john@example.com",
    "firstname": "John",
    "lastname": "Doe",
    "phone": "+1234567890"
  }
}
maton hubspot contact create --set email=john@example.com --set firstname=John --set lastname=Doe --set phone=+1234567890

Update Contact

PATCH /hubspot/crm/v3/objects/contacts/{contactId}
Content-Type: application/json

{
  "properties": {
    "phone": "+0987654321"
  }
}
maton hubspot contact update <contactId> --set phone=+0987654321

Delete Contact

DELETE /hubspot/crm/v3/objects/contacts/{contactId}
maton hubspot contact archive <contactId>

Search Contacts

POST /hubspot/crm/v3/objects/contacts/search
Content-Type: application/json

{
  "filterGroups": [{
    "filters": [{
      "propertyName": "email",
      "operator": "EQ",
      "value": "john@example.com"
    }]
  }],
  "properties": ["email", "firstname", "lastname"]
}
maton hubspot contact search --filter email:EQ:john@example.com --properties email,firstname,lastname

List Companies

GET /hubspot/crm/v3/objects/companies?limit=100&properties=name,domain,industry
maton hubspot company list --properties name,domain,industry -L 100

Get Company

GET /hubspot/crm/v3/objects/companies/{companyId}?properties=name,domain,industry
maton hubspot company view <companyId> --properties name,domain,industry

Create Company

POST /hubspot/crm/v3/objects/companies
Content-Type: application/json

{
  "properties": {
    "name": "Acme Corp",
    "domain": "acme.com",
    "industry": "COMPUTER_SOFTWARE"
  }
}
maton hubspot company create --set name='Acme Corp' --set domain=acme.com --set industry=COMPUTER_SOFTWARE

Note: The industry property requires specific enum values (e.g., COMPUTER_SOFTWARE, FINANCE, HEALTHCARE). Use the List Properties endpoint to get valid values.

Update Company

PATCH /hubspot/crm/v3/objects/companies/{companyId}
Content-Type: application/json

{
  "properties": {
    "industry": "COMPUTER_SOFTWARE",
    "numberofemployees": "50"
  }
}
maton hubspot company update <companyId> --set industry=COMPUTER_SOFTWARE --set numberofemployees=50

Delete Company

DELETE /hubspot/crm/v3/objects/companies/{companyId}
maton hubspot company delete <companyId>

Search Companies

POST /hubspot/crm/v3/objects/companies/search
Content-Type: application/json

{
  "filterGroups": [{
    "filters": [{
      "propertyName": "domain",
      "operator": "CONTAINS_TOKEN",
      "value": "*"
    }]
  }],
  "properties": ["name", "domain"],
  "limit": 10
}
maton hubspot company search --filter 'domain:CONTAINS_TOKEN:*' --properties name,domain -L 10

List Deals

GET /hubspot/crm/v3/objects/deals?limit=100&properties=dealname,amount,dealstage
maton hubspot deal list --properties dealname,amount,dealstage -L 100

Get Deal

GET /hubspot/crm/v3/objects/deals/{dealId}?properties=dealname,amount,dealstage
maton hubspot deal view <dealId> --properties dealname,amount,dealstage

Create Deal

POST /hubspot/crm/v3/objects/deals
Content-Type: application/json

{
  "properties": {
    "dealname": "New Deal",
    "amount": "10000",
    "dealstage": "appointmentscheduled"
  }
}
maton hubspot deal create --set dealname='New Deal' --set amount=10000 --set dealstage=appointmentscheduled

Update Deal

PATCH /hubspot/crm/v3/objects/deals/{dealId}
Content-Type: application/json

{
  "properties": {
    "amount": "15000",
    "dealstage": "qualifiedtobuy"
  }
}
maton hubspot deal update <dealId> --set amount=15000 --set dealstage=qualifiedtobuy

Delete Deal

DELETE /hubspot/crm/v3/objects/deals/{dealId}
maton hubspot deal delete <dealId>

Associate Objects

PUT /hubspot/crm/v4/objects/{fromObjectType}/{fromObjectId}/associations/{toObjectType}/{toObjectId}
Content-Type: application/json

[{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 279}]
maton hubspot associations create --from contacts:<fromObjectId> --to companies:<toObjectId> --type 279

Common association type IDs:

  • 279 - Contact to Company
  • 3 - Deal to Contact
  • 341 - Deal to Company

List Associations

GET /hubspot/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}
maton hubspot associations list --from contacts:12345 --to companies

Batch Read

POST /hubspot/crm/v3/objects/{objectType}/batch/read
Content-Type: application/json

{
  "properties": ["email", "firstname"],
  "inputs": [{"id": "123"}, {"id": "456"}]
}
maton hubspot contact batch-read --id 123,456 --properties email,firstname

Batch Create

POST /hubspot/crm/v3/objects/{objectType}/batch/create
Content-Type: application/json

{
  "inputs": [
    {"properties": {"email": "one@example.com", "firstname": "One"}},
    {"properties": {"email": "two@example.com", "firstname": "Two"}}
  ]
}
maton hubspot contact batch-create --data '[{"properties":{"email":"one@example.com","firstname":"One"}},{"properties":{"email":"two@example.com","firstname":"Two"}}]'

Batch Update

POST /hubspot/crm/v3/objects/{objectType}/batch/update
Content-Type: application/json

{
  "inputs": [
    {"id": "123", "properties": {"firstname": "Updated"}},
    {"id": "456", "properties": {"firstname": "Also Updated"}}
  ]
}
maton hubspot contact batch-update --data '[{"id":"123","properties":{"firstname":"Updated"}},{"id":"456","properties":{"firstname":"Also Updated"}}]'

Batch Archive

POST /hubspot/crm/v3/objects/{objectType}/batch/archive
Content-Type: application/json

{
  "inputs": [{"id": "123"}, {"id": "456"}]
}
maton hubspot contact batch-archive --id 123,456

List Properties

GET /hubspot/crm/v3/properties/{objectType}
maton hubspot properties list --type contacts

Maton Events

contact.created

contact.updated

Parameters

  • property_name (string, optional): Internal property name to match, such as email. Leave blank to match any property change.

contact.deleted

company.created

company.updated

Parameters

  • property_name (string, optional): Internal property name to match, such as name. Leave blank to match any property change.

company.deleted

deal.created

deal.updated

Parameters

  • property_name (string, optional): Internal property name to match, such as amount. Leave blank to match any property change.

deal.deleted

deal.stage_changed

ticket.created

ticket.updated

Parameters

  • property_name (string, optional): Internal property name to match, such as subject. Leave blank to match any property change.

ticket.deleted

Resources

On this page