A HubSpot API mock for creating CRM records.

Seed companies, contacts and deals for your agent. Check its record-creation call, then retrieve the new record’s properties and company associations.

Connect your agent
The test
  • rollout_contract_sent

    deals 301 has dealstage contractsent

  • rollout_kept

    preserved type deals; id 301; except properties dealstage

  • crm_unchanged

    No companies, contacts or deals changed except deals 301

Starting records

  • deals

    id
    301
    dealname
    Ridgeway Robotics — Analytics rollout
    amount
    96000
  • companies

    id
    101
    name
    Ridgeway Robotics
  • contacts

    id
    201
    email
    erin.walsh@ridgeway-robotics.example

Connect your agent to the HubSpot mock

When ancha runs your agent, it sets:

  • HUBSPOT_API_URL
  • HUBSPOT_ACCESS_TOKEN
  • HUBSPOT_CLIENT_SECRET

Point 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.

See all 19 endpoints

associations

POST/crm/v3/associations/:from/:to/batch/:operation
GET/crm/v3/associations/:from/:to/types

objects

GET/crm/v3/objects/:type
POST/crm/v3/objects/:type
GET/crm/v3/objects/:type/:id
PATCH/crm/v3/objects/:type/:id
DELETE/crm/v3/objects/:type/:id
GET/crm/v3/objects/:type/:id/associations/:to
PUT/crm/v3/objects/:type/:id/associations/:to/:toId/:associationType
DELETE/crm/v3/objects/:type/:id/associations/:to/:toId/:associationType
POST/crm/v3/objects/:type/batch/:operation
POST/crm/v3/objects/:type/search
GET/crm/v4/objects/:type/:id/associations/:to

pipelines

GET/crm/v3/pipelines/:type
GET/crm/v3/pipelines/:type/:id
GET/crm/v3/pipelines/:type/:id/stages
GET/crm/v3/pipelines/:type/:id/stages/:stage

properties

GET/crm/v3/properties/:type
GET/crm/v3/properties/:type/:property

Seed your own data

The data the HubSpot mock starts with on every run, cut to a few records. ancha twins seed hubspot prints every field.

Full seed YAML
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

Check what your agent did

Checks YAML
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"

Tested together

All 43 tools

HubSpot API mock FAQ

Will the HubSpot mock catch a duplicate contact email?

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.

How are HubSpot search filter groups combined?

In the mock, POST /crm/v3/objects/contacts/search 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.

What happens if a CRM agent puts a deal in the wrong pipeline stage?

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.

Book a demo

Ancha is not affiliated with HubSpot.