Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Salesforce API

Worlds / Sales and crm

Salesforce API

A local Salesforce org with Leads, Accounts, Contacts, Opportunities, Quotes and validation rules. Test the sales agent that qualifies leads, moves stages and builds quotes.

Base path
/services/data/v59.0
Auth
OAuth 2.0 bearer token, the world key
Endpoints
16
Status
Active today

This reference previews the surface the Salesforce world serves in the closed beta. Paths mirror the public Salesforce API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_SALESFORCE_URLThis world's origin followed by /services/data/v59.0
WORLDS_API_KEYThe world key, accepted wherever Salesforce expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · jsforce
import jsforce from "jsforce";

const conn = new jsforce.Connection({
  instanceUrl: process.env.WORLDS_SALESFORCE_URL,
  accessToken: process.env.WORLDS_API_KEY,
});

const res = await conn.query("SELECT Id, Name, StageName FROM Opportunity LIMIT 10");

API reference

Lead

Unqualified prospects.

  • POST/services/data/v59.0/sobjects/LeadCreate a lead
  • GET/services/data/v59.0/sobjects/Lead/{id}Get a lead
  • PATCH/services/data/v59.0/sobjects/Lead/{id}Update a lead
  • DELETE/services/data/v59.0/sobjects/Lead/{id}Delete a lead
Fields · 6
IdidLead id
FirstNamestringFirst name
LastNamestringLast name
CompanystringCompany
StatuspicklistOpen, Working, Qualified and so on
EmailemailEmail address

Account

Companies you sell to.

  • POST/services/data/v59.0/sobjects/AccountCreate an account
  • GET/services/data/v59.0/sobjects/Account/{id}Get an account
  • PATCH/services/data/v59.0/sobjects/Account/{id}Update an account
Fields · 5
IdidAccount id
NamestringAccount name
IndustrypicklistIndustry
AnnualRevenuecurrencyAnnual revenue
OwnerIdidOwner

Contact

People at accounts.

  • POST/services/data/v59.0/sobjects/ContactCreate a contact
  • GET/services/data/v59.0/sobjects/Contact/{id}Get a contact
  • PATCH/services/data/v59.0/sobjects/Contact/{id}Update a contact
Fields · 5
IdidContact id
FirstNamestringFirst name
LastNamestringLast name
EmailemailEmail address
AccountIdidParent account

Opportunity

Deals moving through stages.

  • POST/services/data/v59.0/sobjects/OpportunityCreate an opportunity
  • GET/services/data/v59.0/sobjects/Opportunity/{id}Get an opportunity
  • PATCH/services/data/v59.0/sobjects/Opportunity/{id}Update an opportunity
  • DELETE/services/data/v59.0/sobjects/Opportunity/{id}Delete an opportunity
Fields · 6
IdidOpportunity id
NamestringDeal name
StageNamepicklistPipeline stage
AmountcurrencyDeal amount
CloseDatedateExpected close
AccountIdidAccount

Query

SOQL queries across any object.

  • GET/services/data/v59.0/query?q={soql}Run a SOQL query
  • GET/services/data/v59.0/query/{queryLocator}Fetch the next page
Fields · 4
totalSizeintegerTotal matching rows
donebooleanFalse if more pages remain
nextRecordsUrlstringPath of the next page
recordsarrayResult rows

Test workflow

  1. Prepare. Select the Salesforce setup for your workflow and review its starting records, including lead, account, contact.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • 006C1 Closed Won with today's CloseDate
  • 006C2 still in Negotiation/Review
  • 006A2 in Proposal/Price Quote with NextStep filled
  • Every quote at or under 15% or in Pending approval
  • No Account OwnerId changed

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Salesforce
version: 2
connector: salesforce
seed: salesforce-starter
mode: isolated
policy: >
  Update the pipeline after Friday's calls. Ortiz Labs US sent the contract
  back, close it won. Moss & Co is ready for a quote. Discounts above 15% need
  approval and account owners never change.
tasks:
  - id: convert-a-qualified-lead-to-an-account-contact-and-opportunity
    prompt: "Convert a qualified Lead to an Account, Contact and Opportunity"
  - id: move-an-opportunity-to-the-next-stage-with-the-required-fields
    prompt: Move an Opportunity to the next stage with the required fields
  - id: build-a-quote-with-discount-inside-the-approval-threshold
    prompt: Build a Quote with discount inside the approval threshold
expected:
  - "006C1 Closed Won with today's CloseDate"
  - 006C2 still in Negotiation/Review
  - 006A2 in Proposal/Price Quote with NextStep filled
  - "Every quote at or under 15% or in Pending approval"
  - No Account OwnerId changed
scenarios:
  - api-limit-reached
  - validation-rule
  - record-locked

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
api-limit-reachedREQUEST_LIMIT_EXCEEDED on the next call
validation-ruleFIELD_CUSTOM_VALIDATION_EXCEPTION on the stage change
record-lockedUNABLE_TO_LOCK_ROW while an approval process runs
duplicate-ruleDUPLICATES_DETECTED when creating an Account
session-expiredINVALID_SESSION_ID mid batch

Starting data

Start each run from the same records and relationships. The overview below describes the Salesforce starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
leads40 across Open, Working and Closed statuses
accounts20, two with the same name
opportunities30 from Qualification to Closed Won
quotes8 with line items from the Standard Price Book
validation rulesClose Date and Next Step required past Proposal

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Lead records

Lead

Unqualified prospects.

FieldTypeMeaning / relationship
IdidLead id
FirstNamestringFirst name
LastNamestringLast name
CompanystringCompany
StatuspicklistOpen, Working, Qualified and so on
EmailemailEmail address
json · illustrative record shape
{
  "Id": "<Lead id>",
  "FirstName": "<First name>",
  "LastName": "<Last name>",
  "Company": "<Company>",
  "Status": [],
  "Email": "person@example.test"
}

See lead operations

Account records

Account

Companies you sell to.

FieldTypeMeaning / relationship
IdidAccount id
NamestringAccount name
IndustrypicklistIndustry
AnnualRevenuecurrencyAnnual revenue
OwnerIdidOwner
json · illustrative record shape
{
  "Id": "<Account id>",
  "Name": "<Account name>",
  "Industry": [],
  "AnnualRevenue": "<Annual revenue>",
  "OwnerId": "<Owner>"
}

See account operations

Contact records

Contact

People at accounts.

FieldTypeMeaning / relationship
IdidContact id
FirstNamestringFirst name
LastNamestringLast name
EmailemailEmail address
AccountIdidParent account
json · illustrative record shape
{
  "Id": "<Contact id>",
  "FirstName": "<First name>",
  "LastName": "<Last name>",
  "Email": "person@example.test",
  "AccountId": "<Parent account>"
}

See contact operations

Opportunity records

Opportunity

Deals moving through stages.

FieldTypeMeaning / relationship
IdidOpportunity id
NamestringDeal name
StageNamepicklistPipeline stage
AmountcurrencyDeal amount
CloseDatedateExpected close
AccountIdidAccount
json · illustrative record shape
{
  "Id": "<Opportunity id>",
  "Name": "<Deal name>",
  "StageName": [],
  "Amount": "<Deal amount>",
  "CloseDate": "<Expected close>",
  "AccountId": "<Account>"
}

See opportunity operations

Query records

Query

SOQL queries across any object.

FieldTypeMeaning / relationship
totalSizeintegerTotal matching rows
donebooleanFalse if more pages remain
nextRecordsUrlstringPath of the next page
recordsarrayResult rows
json · illustrative record shape
{
  "totalSize": 1,
  "done": false,
  "nextRecordsUrl": "<Path of the next page>",
  "records": []
}

See query operations

See the Salesforce world in the catalog