HubSpot Deals (via hubspot CLI)
Deals track revenue opportunities through a sales pipeline. Each deal lives in a pipeline and a stage.
Auth
Set HUBSPOT_ACCESS_TOKEN. Optional --profile <name>.
Canonical commands
| Intent | Command |
|---|---|
| List | hubspot crm deals list --limit 20 --properties dealname,amount,dealstage,closedate |
| Get by ID | hubspot crm deals get 12345 |
| Create | hubspot crm deals create --dealname "Q2 Expansion" --amount 50000 --stageid appointmentscheduled |
| Create from JSON | hubspot crm deals create --properties '{"dealname":"Q2","amount":"50000","pipeline":"default","dealstage":"appointmentscheduled"}' |
| Update stage | hubspot crm deals update 12345 --properties '{"dealstage":"contractsent"}' |
| Close-won | hubspot crm deals update 12345 --properties '{"dealstage":"closedwon","closedate":"2025-06-01T00:00:00Z"}' |
| Delete | hubspot crm deals delete 12345 --yes |
| Search by stage | hubspot crm deals search --filter-groups '[{"filters":[{"propertyName":"dealstage","operator":"EQ","value":"closedwon"}]}]' |
| Open deals | hubspot crm deals search --filter-groups '[{"filters":[{"propertyName":"dealstage","operator":"NOT_IN","values":["closedwon","closedlost"]}]}]' |
| Batch create | hubspot crm deals batch-create --inputs '[...]' |
Pipelines and stages
Deal stages are pipeline-specific. Always list them before creating or moving deals:
hubspot crm pipelines list deals
hubspot crm pipelines stages deals <pipeline_id>
Use the internal dealstage id (e.g. appointmentscheduled, qualifiedtobuy, contractsent, closedwon, closedlost), not the display label.
Common properties
dealname, amount, dealstage, pipeline, closedate, hubspot_owner_id, dealtype, description, hs_priority.
Associating deals
# Associate deal 12345 with contact 67890
hubspot crm associations create deals 12345 contacts 67890
# And with company 54321
hubspot crm associations create deals 12345 companies 54321
Output / errors
Standard {success, data, paging}. Error codes: AUTH_ERROR (3), VALIDATION_ERROR (5), NOT_FOUND (6), RATE_LIMIT (7).
Scopes
- Read:
crm.objects.deals.read - Write:
crm.objects.deals.write
Tips
amountis a string (HubSpot returns all numeric properties as strings). Quote it in JSON.closedatemust be ISO-8601 UTC.- Use
--output json-prettyonly when the user explicitly wants to read the JSON.