Sales agent
Gmail
Salesforce
HubSpot
Seed companies, contacts and deals for your agent. Check its record-creation call, then retrieve the new record’s properties and company associations.
rollout_contract_sentdeals 301 has dealstage contractsent
rollout_keptpreserved type deals; id 301; except properties dealstage
crm_unchangedNo companies, contacts or deals changed except deals 301
Starting records
deals
301Ridgeway Robotics — Analytics rollout96000companies
101Ridgeway Roboticscontacts
201erin.walsh@ridgeway-robotics.exampleWhen ancha runs your agent, it sets:
HUBSPOT_API_URLHUBSPOT_ACCESS_TOKENHUBSPOT_CLIENT_SECRETPoint the client you already use at them.
const response = await fetch(process.env.HUBSPOT_API_URL + '/crm/v3/objects/companies', { headers: { Authorization: 'Bearer ' + process.env.HUBSPOT_ACCESS_TOKEN } });
const companies = await response.json();Locally, ancha runs your agent as an ordinary process, so keep real HubSpot credentials out of its environment.
/crm/v3/associations/:from/:to/batch/:operation/crm/v3/associations/:from/:to/types/crm/v3/objects/:type/crm/v3/objects/:type/crm/v3/objects/:type/:id/crm/v3/objects/:type/:id/crm/v3/objects/:type/:id/crm/v3/objects/:type/:id/associations/:to/crm/v3/objects/:type/:id/associations/:to/:toId/:associationType/crm/v3/objects/:type/:id/associations/:to/:toId/:associationType/crm/v3/objects/:type/batch/:operation/crm/v3/objects/:type/search/crm/v4/objects/:type/:id/associations/:to/crm/v3/pipelines/:type/crm/v3/pipelines/:type/:id/crm/v3/pipelines/:type/:id/stages/crm/v3/pipelines/:type/:id/stages/:stage/crm/v3/properties/:type/crm/v3/properties/:type/:propertyThe data the HubSpot mock starts with on every run, cut to a few records. ancha twins seed hubspot prints every field.
twins:
- hubspot
seed:
hubspot:
portal:
id: "510001"
name: Acme
access: {}
companies:
- id: "101"
properties:
name: Ridgeway Robotics
domain: ridgeway-robotics.example
industry: MANUFACTURING
numberofemployees: "850"
annualrevenue: "125000000"
lifecyclestage: opportunity
external_id: ridgeway-robotics
contacts:
- id: "201"
properties:
firstname: Erin
lastname: Walsh
email: erin.walsh@ridgeway-robotics.example
jobtitle: VP Operations
lifecyclestage: opportunity
external_id: erin-ridgeway
deals:
- id: "301"
properties:
dealname: Ridgeway Robotics — Analytics rollout
amount: "96000"
closedate: 2026-11-30T00:00:00.000Z
pipeline: default
dealstage: presentationscheduled
external_id: ridgeway-rollout
pipelines:
- id: default
label: Sales Pipeline
displayOrder: 0
stages:
- id: presentationscheduled
label: Presentation scheduled
displayOrder: 2
metadata:
probability: "0.6"
associations:
- from:
type: contacts
id: "201"
to:
type: companies
id: "101"
typeId: 1
checks:
- id: rollout_contract_sent
state:
hubspot.record:
type: deals
id: "301"
properties:
dealstage: contractsent
- id: rollout_kept
state:
hubspot.preserved:
type: deals
id: "301"
except_properties:
- dealstage
- id: crm_unchanged
state:
hubspot.unchanged:
types:
- companies
- contacts
- deals
except:
- type: deals
id: "301"Ancha’s HubSpot mock returns 409 with category CONFLICT when a contact uses an email already held by another unarchived contact. The email comparison ignores letter case.
In the mock, POST / requires all filters within a group to match and accepts a record when any group matches. Use paging.next.after as the next request’s after value to read more results.
The HubSpot mock checks that dealstage belongs to the selected pipeline. A mismatch returns 400 with category VALIDATION_ERROR and code INVALID_OPTION.
Install the CLI and run your agent against the HubSpot mock.
Ancha is not affiliated with HubSpot.