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

Worlds / Support

Salesforce Service Cloud API

A local Service Cloud org with Cases, Accounts, Contacts, queues, entitlements and milestones. Test the agent that works the case queue, sets status and escalates on time.

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

This reference previews the surface the Salesforce Service Cloud world serves in the closed beta. Paths mirror the public Salesforce Service Cloud 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_SERVICE_CLOUD_URLThis world's origin followed by /services/data/v59.0
WORLDS_API_KEYThe world key, accepted wherever Salesforce Service Cloud 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_SERVICE_CLOUD_URL,
  accessToken: process.env.WORLDS_API_KEY,
});

const res = await conn.query("SELECT Id, Subject, Status FROM Case LIMIT 10");

API reference

Case

Customer issues worked by support agents.

  • GET/services/data/v59.0/sobjects/CaseDescribe the Case object
  • POST/services/data/v59.0/sobjects/CaseCreate a case
  • GET/services/data/v59.0/sobjects/Case/{id}Get a case
  • PATCH/services/data/v59.0/sobjects/Case/{id}Update a case
  • DELETE/services/data/v59.0/sobjects/Case/{id}Delete a case
Fields · 7
IdidCase id
CaseNumberstringAuto-numbered label
SubjectstringShort summary
StatuspicklistNew, Working, Escalated or Closed
PrioritypicklistHigh, Medium or Low
ContactIdidContact who raised it
OwnerIdidAgent or queue

Contact

People at customer 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

CaseComment

Public or internal notes on a case.

  • POST/services/data/v59.0/sobjects/CaseCommentAdd a comment
  • GET/services/data/v59.0/sobjects/CaseComment/{id}Get a comment
Fields · 4
IdidComment id
ParentIdidCase id
CommentBodytextareaComment text
IsPublishedbooleanVisible to the customer

Account

Companies you support.

  • 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 · 4
IdidAccount id
NamestringAccount name
IndustrypicklistIndustry
OwnerIdidAccount owner

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 Service Cloud setup for your workflow and review its starting records, including case, contact, casecomment.
  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

  • Case 00001041 Escalated, owner Tier 2 queue
  • Case 00001043 still New in Tier 1
  • Case 00001042 Closed with Reason and a case comment
  • No milestone completed without a reply
  • No OwnerId set to an inactive user

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 Service Cloud
version: 2
connector: salesforce-service-cloud
seed: salesforce-service-cloud-starter
mode: isolated
policy: >
  Work the Tier 1 queue. Escalate only Premium cases within an hour of their
  First Response milestone. Close resolved cases with a Reason and a comment.
  Watch for accounts with the same name in different regions.
tasks:
  - id: take-a-case-from-a-queue-and-set-its-status
    prompt: Take a case from a queue and set its status
  - id: escalate-a-case-that-is-about-to-miss-a-milestone
    prompt: Escalate a case that is about to miss a milestone
  - id: close-a-case-with-the-right-reason-and-comment
    prompt: Close a case with the right reason and comment
expected:
  - "Case 00001041 Escalated, owner Tier 2 queue"
  - Case 00001043 still New in Tier 1
  - Case 00001042 Closed with Reason and a case comment
  - No milestone completed without a reply
  - No OwnerId set to an inactive user
scenarios:
  - api-limit-reached
  - record-locked
  - validation-rule

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
record-lockedUNABLE_TO_LOCK_ROW while an assignment rule runs
validation-ruleFIELD_CUSTOM_VALIDATION_EXCEPTION: Reason required to close
session-expiredINVALID_SESSION_ID halfway through the batch
milestone-violationThe clock passes the First Response target

Starting data

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

RecordsStarting setup
cases50 across New, Working, Escalated and Closed
queuesTier 1, Tier 2, Billing
entitlementsStandard and Premium with First Response milestones
accounts15, two with the same name in different regions
escalation rules1 active rule on Priority High

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.

Case records

Case

Customer issues worked by support agents.

FieldTypeMeaning / relationship
IdidCase id
CaseNumberstringAuto-numbered label
SubjectstringShort summary
StatuspicklistNew, Working, Escalated or Closed
PrioritypicklistHigh, Medium or Low
ContactIdidContact who raised it
OwnerIdidAgent or queue
json · illustrative record shape
{
  "Id": "<Case id>",
  "CaseNumber": "<Auto-numbered label>",
  "Subject": "<Short summary>",
  "Status": [],
  "Priority": [],
  "ContactId": "<Contact who raised it>"
}

See case operations

Contact records

Contact

People at customer 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

CaseComment records

CaseComment

Public or internal notes on a case.

FieldTypeMeaning / relationship
IdidComment id
ParentIdidCase id
CommentBodytextareaComment text
IsPublishedbooleanVisible to the customer
json · illustrative record shape
{
  "Id": "<Comment id>",
  "ParentId": "<Case id>",
  "CommentBody": "<Comment text>",
  "IsPublished": false
}

See casecomment operations

Account records

Account

Companies you support.

FieldTypeMeaning / relationship
IdidAccount id
NamestringAccount name
IndustrypicklistIndustry
OwnerIdidAccount owner
json · illustrative record shape
{
  "Id": "<Account id>",
  "Name": "<Account name>",
  "Industry": [],
  "OwnerId": "<Account owner>"
}

See account 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 Service Cloud world in the catalog