HubSpot Companies (via hubspot CLI)
Companies represent organizations. Contacts and deals associate to them. All commands return {"success": true, "data": ...}.
Auth
Set HUBSPOT_ACCESS_TOKEN in the environment (HubSpot private-app token). Optional: --profile <name> for multi-portal setups.
Canonical commands
| Intent | Command |
|---|---|
| List | hubspot crm companies list --limit 20 |
| Get by ID | hubspot crm companies get 12345 |
| Create | hubspot crm companies create --name "Acme Inc" --domain acme.com |
| Create from JSON | hubspot crm companies create --properties '{"name":"Acme","industry":"SOFTWARE"}' |
| Update | hubspot crm companies update 12345 --properties '{"industry":"RETAIL"}' |
| Delete | hubspot crm companies delete 12345 --yes |
| Search by domain | hubspot crm companies search --query "domain:acme.com" |
| Filtered search | hubspot crm companies search --filter-groups '[{"filters":[{"propertyName":"numberofemployees","operator":"GT","value":"100"}]}]' |
| Batch create | hubspot crm companies batch-create --inputs '[{"properties":{"name":"A"}},{"properties":{"name":"B"}}]' |
| Discover properties | hubspot discover properties companies |
Associating contacts and deals
# List contacts associated to company 12345
hubspot crm associations list companies 12345 contacts
# Link company 12345 to contact 67890
hubspot crm associations create companies 12345 contacts 67890
# Remove the link
hubspot crm associations delete companies 12345 contacts 67890
Common properties
name, domain, industry, numberofemployees, annualrevenue, phone, city, state, country, hubspot_owner_id, lifecyclestage. Use hubspot discover properties companies for the full list.
Output / errors
Shape matches the contacts skill: {success, data, paging} envelope. Error codes: AUTH_ERROR (3), VALIDATION_ERROR (5), NOT_FOUND (6), RATE_LIMIT (7), SERVER_ERROR (8).
Scopes
- Read:
crm.objects.companies.read - Write:
crm.objects.companies.write
Tips
- The
domainproperty is the most reliable dedupe key. Before creating, search:hubspot crm companies search --query "domain:<domain>". - Use
listwith--properties name,domain,industryto keep list payloads small.