A Salesforce API mock for creating CRM records.

Give your agent seeded accounts, contacts and opportunities. Check its record-creation request, then query the record’s fields and account relationships with SOQL.

Connect your agent
The test
  • contact_created

    Calls POST /services/data/v67.0/sobjects/Contact

Starting records

  • contacts

    Id
    003000000000001AAA
    Email
    erin.walsh@ridgeway-robotics.example
  • accounts

    Id
    001000000000001AAA
    Name
    Ridgeway Robotics

Connect your agent to the Salesforce mock

When ancha runs your agent, it sets:

  • SALESFORCE_INSTANCE_URL
  • SALESFORCE_ACCESS_TOKEN

Point the client you already use at them.

const response = await fetch(process.env.SALESFORCE_INSTANCE_URL + '/services/data/v67.0/query?q=' + encodeURIComponent('SELECT Id, Name FROM Account'), { headers: { Authorization: 'Bearer ' + process.env.SALESFORCE_ACCESS_TOKEN } });
const accounts = await response.json();

Locally, ancha runs your agent as an ordinary process, so keep real Salesforce credentials out of its environment.

See all 14 endpoints

composite

POST/services/data/v67.0/composite

query

GET/services/data/v67.0/query
GET/services/data/v67.0/query/:locator

sobjects

GET/services/data/v67.0/sobjects
GET/services/data/v67.0/sobjects/:type
POST/services/data/v67.0/sobjects/:type
GET/services/data/v67.0/sobjects/:type/:field/:value
PATCH/services/data/v67.0/sobjects/:type/:field/:value
GET/services/data/v67.0/sobjects/:type/:id
PATCH/services/data/v67.0/sobjects/:type/:id
DELETE/services/data/v67.0/sobjects/:type/:id
GET/services/data/v67.0/sobjects/:type/describe

versions

GET/services/data/
GET/services/data/v67.0

Seed your own data

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

Full seed YAML
twins:
  - salesforce
seed:
  salesforce:
    org:
      id: 00D000000000001AAA
      name: Acme
    access: {}
    accounts:
      - Id: 001000000000001AAA
        Name: Ridgeway Robotics
        Industry: Manufacturing
        Type: Prospect
        Website: https://ridgeway-robotics.example
        NumberOfEmployees: 850
        AnnualRevenue: 125000000
        External_Id__c: ridgeway-robotics
    contacts:
      - Id: 003000000000001AAA
        FirstName: Erin
        LastName: Walsh
        Email: erin.walsh@ridgeway-robotics.example
        Title: VP Operations
        AccountId: 001000000000001AAA
        External_Id__c: erin-ridgeway
    leads:
      - Id: 00Q000000000001AAA
        FirstName: Theo
        LastName: Reed
        Company: Beacon Logistics
        Email: theo.reed@beacon-logistics.example
        Status: Working - Contacted
        LeadSource: LinkedIn
        External_Id__c: beacon-theo
    opportunities:
      - Id: 006000000000001AAA
        Name: Ridgeway Robotics — Analytics rollout
        AccountId: 001000000000001AAA
        StageName: Proposal/Price Quote
        CloseDate: 2026-11-30
        Amount: 96000
        Probability: 60
        CampaignId: 701000000000001AAA
        External_Id__c: ridgeway-rollout
    campaigns:
      - Id: 701000000000001AAA
        Name: Ridgeway Robotics Q4 pilot
        Type: Advertisement
        Status: In Progress
        IsActive: true
        StartDate: 2026-10-01
        EndDate: 2026-12-31
        BudgetedCost: 12000
        ActualCost: 3400
        ClientAccount__c: 001000000000001AAA
        External_Id__c: ridgeway-q4-pilot
    campaignMembers:
      - Id: 00v000000000001AAA
        CampaignId: 701000000000001AAA
        ContactId: 003000000000001AAA
        Status: Responded

Check what your agent did

Checks YAML
checks:
  - id: contact_created
    trace:
      called: POST /services/data/v67.0/sobjects/Contact

Tested together

All 43 tools

Salesforce API mock FAQ

Can a Salesforce agent create or update a record using an external ID?

The mock accepts PATCH /services/data/v67.0/sobjects/Account/External_Id__c/{value} and updates the matching account or creates one. The response includes created; updateOnly=true makes a missing external ID return 404 instead of creating a record.

What should a Salesforce agent do when a SOQL response has done set to false?

Follow the mock’s nextRecordsUrl until done is true. Each query locator holds the original result set and expires after 15 minutes on the simulated clock, returning 400 with INVALID_QUERY_LOCATOR.

Will a failed Salesforce composite request undo earlier writes?

Set allOrNone: true on the mock’s /services/data/v67.0/composite request. If a subrequest fails, the transaction rolls back; that subrequest retains its error and the others return PROCESSING_HALTED.

Install the CLI and run your agent against the Salesforce mock.

Book a demo

Ancha is not affiliated with Salesforce.