HubSpot Launches Agent CLI: AI Agents Automate Marketing and Sales Workflows
In May 2026, HubSpot introduced the Agent CLI (command-line interface), bringing HubSpot's data and intelligence into the environments where go-to-market (GTM) and operations teams are composing their own workflows — Codex, Claude Cowork, and Claude Code — and letting AI agents automate repetitive, bulk, and scheduled work.
The simplest way to think about it: take the questions you keep asking, or the tasks you keep completing, in chat, and automate them. Build automations in Codex or schedule them in Cowork, and the work happens on its own before you even get to your desk.
The CLI is built on the same foundation as HubSpot's public APIs and MCP server that power its AI Connectors, and it is designed to complement them, not replace them. AI Connectors are great for work with a human in the loop: questions, insights, conversations, and campaign analytics. The Agent CLI can handle those too, but it is especially useful for the repetitive, bulk, and scheduled work that needs to run without a human in the loop.
Here is how the two divide the work:
| Aspect | AI Connectors | Agent CLI |
|---|---|---|
| Typical use | Questions, insights, conversations | Bulk, scheduled, repetitive tasks |
| Human in the loop | Usually needed | Not needed |
| Execution environment | Inside the HubSpot platform | External environments like Codex / Claude |
| Representative cases | Campaign analytics | Deal scanning, data cleaning, account reviews |
How the Agent CLI strengthens agents working on HubSpot
The Agent CLI helps GTM and ops teams automate and schedule routine tasks, reports, and actions so they get more time back for the work that matters. For example:
- A marketer can ask for a report every Monday at 8 a.m. that surfaces high-fit contacts with no associated deal, no recent sales activity, or missing key enrichment fields, then sends RevOps a prioritized cleanup list with suggested next actions.
- Sales and RevOps can run a daily scan of the pipeline for deals closing this week with no activity in the past five days and request a summary.
- Customer Success can get an automated account review that summarizes open deals, recent support activity, and the latest NPS score for each account.
- Support can set up an automation so that whenever a new ticket arrives from a top-tier account, the agent pulls the last five tickets, summarizes each resolution, and flags recurring issue patterns.
The work happens in the background, ready when you need it.
A concrete automation example
Translated into concrete steps, it looks roughly like this: after configuring the HubSpot Agent CLI inside Claude Code or Codex, you describe the task in natural language and the agent turns it into HubSpot API calls for both reads and writes. For "every Monday at 8 a.m., find deals closing this week with no activity in the past five days," the flow could be:
1. Provide credentials: give the CLI an Access Token from a HubSpot Private App;
2. Describe the task in natural language: scan the pipeline for deals closing
this week with no activity in the past five days;
3. The agent translates it into API calls (e.g., GET /crm/v3/objects/deals
with the right filters);
4. Schedule it: trigger every Monday at 08:00 in Cowork and output the summary
to your chosen channel.
The point here: you control the task description, the filter logic, and the output format, while the agent turns natural language into a repeatable workflow. Compared with logging into the CRM and filtering deal-by-deal by hand, this flow saves twenty to thirty minutes a week and never misses a key deal because someone was too busy.
Two details are worth planning ahead: first, permission boundaries — create the Access Token given to the CLI with least privilege, scoped to only the objects and operations it truly needs, rather than full CRM access; second, output validation — clean-up lists and summaries produced by automation still need spot checks by a human, especially for operations that delete or bulk-modify. Run read-only queries first, get human confirmation, and only then execute writes.
Why agent infrastructure optionality matters
HubSpot is building a platform where agent infrastructure is a choice your agents make based on what is right for your workflow. An agent constrained to a single infrastructure is less effective than it could be. Just as customers should be free to choose the best tools for their business, agents should have the same freedom — whether they are running a scheduled automation, processing a bulk operation, or acting on a real-time signal.
The direction is clear: wherever agents are working, and whatever infrastructure they run on, HubSpot supports it. The Agent CLI is available in private beta now.
Reference: HubSpot product updates and beta signup https://www.hubspot.com/product-updates; HubSpot Developer docs https://developers.hubspot.com/
16IDC perspective
For business teams, the Agent CLI answers a more fundamental question: a CRM is no longer just a system that records customer data — it can be a workflow engine driven by AI agents. When comparing CRM systems, it is worth checking whether a platform exposes open APIs, an MCP server, or a CLI, because that decides whether marketing and sales automation can truly be handed off to agents. Combined with email marketing automation, high-frequency customer operations can gradually become automated workflows. See more in the Business Tools category.
Source: https://blog.hubspot.com/marketing/introducing-the-hubspot-agent-cli
Implementation Checklist
Example 1: Write agent findings back to CRM contacts
export HUBSPOT_TOKEN="$HUBSPOT_PRIVATE_APP_TOKEN"
# 1) Create or update a contact; email is the default dedupe key
curl -s -X POST "https://api.hubapi.com/crm/v3/objects/contacts" \
-H "Authorization: Bearer $HUBSPOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"properties": {
"email": "[email protected]",
"lifecyclestage": "lead",
"hs_lead_status": "NEW"
}
}' | jq '{id, properties: .properties.email}'
# 2) Confirm token scopes first; most 401 and 403 responses are missing scopes
curl -s -o /dev/null -w '%{http_code}\n' \
-H "Authorization: Bearer $HUBSPOT_TOKEN" \
"https://api.hubapi.com/crm/v3/objects/contacts?limit=1"
The trap for automated agents is the dedupe key: differing email case or stray spaces creates duplicate contacts.
Example 2: Batch writes through the official SDK instead of one request per row
import os
from hubspot import HubSpot
from hubspot.crm.contacts import SimplePublicObjectInputForCreate
client = HubSpot(access_token=os.environ["HUBSPOT_TOKEN"])
leads = [
{"email": "[email protected]", "lifecyclestage": "lead"},
{"email": "[email protected]", "lifecyclestage": "lead"},
]
results = []
for lead in leads:
payload = SimplePublicObjectInputForCreate(properties=lead)
results.append(client.crm.contacts.basic_api.create(
simple_public_object_input_for_create=payload
))
print(len(results), "contacts written")
print([r.id for r in results][:5])
SDK method names change across major versions, so follow the official repository changelog when upgrading.
Three Access Paths Side by Side: Connectors, Agent CLI and Private App Calls
HubSpot splits its automation surface into three layers: AI Connectors inside the platform, the Agent CLI running in Codex and Claude environments, and the public API plus MCP server both sit on. The difference is not data permission but who triggers the job, where it executes, and who holds the credential.
The CLI introduces no new endpoints; it calls the same REST paths: GET /crm/v3/objects/deals to read the pipeline, POST /crm/v3/objects/contacts to write a contact. So the first question is whether the task genuinely needs an external agent to generate filter conditions from natural language, rather than a fixed platform workflow.
| Dimension | AI Connectors | Agent CLI | Private app API calls |
|---|---|---|---|
| Trigger | In-platform conversation, on demand | Natural-language task plus Cowork schedule (e.g. Monday 08:00) | Your own script or scheduler |
| Execution environment | Inside the HubSpot platform | External environments such as Codex / Claude | A server your team manages |
| Credential | In-platform authorization | Private App Access Token | Private App Access Token |
| Human in the loop | Usually required | Not required; runs on schedule | Depends on script design |
| Typical case | Campaign analytics | Deal scanning, data cleanup, account reviews | Custom bulk writes |
Token Scope and Write-Back Checks Before Automation Goes Live
Permission and verification are the two settings most often underestimated. A Private App Access Token decides which objects the agent may read and whether it can write; the same token handed to a CLI or to your own script carries the same risk, so listing required scopes per task beats bundling them by role when you audit later.
One read-only request is enough to check the token's reach: call GET /crm/v3/objects/contacts with limit=1. A 401 or 403 means a missing scope or a dead token; a 200 means the auth path works. Re-run the same read before writing and compare counts, which confirms the agent did not treat case or whitespace variants of an email as new contacts.
email is the dedupe key at write time, and enumeration fields such as hs_lead_status and lifecyclestage accept a wrong value silently, only filing the lead under the wrong stage. For deletes or bulk edits, run read-only queries, spot-check by hand, then execute the write — treat the agent's output as a draft, not a final record.
Limitations
- This article reflects public information as of 2026-08-05; terms, prices and quotas follow the provider's current published terms.
- Third-party capability and limit statements follow their official documentation; no further commitment is implied here.
- Licensing, filing and data-residency decisions must be verified against the regulations of your operating region.
FAQ
Agent CLI or AI Connectors: which one to use?
Split by whether a human stays in the loop. Connectors run inside HubSpot for questions, insight and campaign analysis, usually with a person involved; Agent CLI runs in Codex or Claude environments on bulk, scheduled and repetitive jobs such as a Monday 08:00 cleanup list. It complements Connectors rather than replacing them.
How narrow should the access token be?
As narrow as the task allows. Create the private app token with only the objects and operations the job needs, never full CRM access, and keep write actions behind a read-only query and a human check. The agent calls the API underneath, for example GET /crm/v3/objects/deals, so an over-scoped token hands automation your write access.
Is the Agent CLI available in general release yet?
Not yet; it is in private beta. Announced in May 2026, the Agent CLI is requested through the product-updates page, so apply there and prepare the private app credentials first. Decide which single report or cleanup you want automated before applying, because a vague first task is what agents execute badly.
Related Providers
- HubSpot: use it when CLI output must land back on CRM records and lifecycle stages.
- n8n: choose it when the orchestration layer must be self-hosted and scriptable.
- Workato: look at it when cross-app connections and permission governance sit in one iPaaS.
Community & Resources
Official docs and communities
- HubSpot developer overview — Authentication options and API boundaries
- HubSpot CRM contacts API — Fields and batch endpoints for creating and updating contacts
- HubSpot webhooks — Subscribe to events and validate request origin
- HubSpot community — Public forum for developers and operators
Learning resources and tools
- hubspot-api-python — Official Python client
- Stack Overflow · hubspot — API and workflow automation questions
Original source: HubSpot Blog ↗