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

Worlds / Eng and it ops

ServiceNow API

A local ServiceNow instance with incidents, requested items, change requests, approvals and CMDB configuration items. Test the IT agent that triages, resolves and routes tickets and respects change windows.

Base path
/api/now
Auth
OAuth bearer token or basic auth, the world key
Endpoints
14
Status
Active today

This reference previews the surface the ServiceNow world serves in the closed beta. Paths mirror the public ServiceNow 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_SERVICENOW_URLThis world's origin followed by /api/now
WORLDS_API_KEYThe world key, accepted wherever ServiceNow expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · fetch
const base = process.env.WORLDS_SERVICENOW_URL;

const res = await fetch(base + "/api/now/table/incident?sysparm_limit=20&sysparm_query=active=true", {
  headers: {
    Authorization: "Bearer " + process.env.WORLDS_API_KEY,
    Accept: "application/json",
  },
});

const { result } = await res.json();

API reference

Incidents

Break and fix tickets in the incident table.

  • GET/api/now/table/incidentList incidents
  • POST/api/now/table/incidentCreate an incident
  • GET/api/now/table/incident/{sys_id}Get an incident
  • PATCH/api/now/table/incident/{sys_id}Update an incident
  • DELETE/api/now/table/incident/{sys_id}Delete an incident
Fields · 6
sys_idstringRecord id
numberstringNumber such as INC0010001
short_descriptionstringSummary
statestringNew, In Progress, On Hold, Resolved or Closed
prioritystring1 critical through 5 planning
assigned_toreferenceAssignee

Change requests

Planned changes with risk and approval state.

  • GET/api/now/table/change_requestList change requests
  • POST/api/now/table/change_requestCreate a change request
  • PATCH/api/now/table/change_request/{sys_id}Update a change request
Fields · 5
sys_idstringRecord id
numberstringNumber such as CHG0030001
typestringNormal, Standard or Emergency
riskstringRisk rating
approvalstringApproval state

Users

People who raise and work tickets.

  • GET/api/now/table/sys_userList users
  • GET/api/now/table/sys_user/{sys_id}Get a user
  • GET/api/now/table/sys_user_groupList groups
Fields · 5
sys_idstringRecord id
user_namestringUser name
namestringFull name
emailstringEmail
departmentreferenceDepartment

Knowledge articles

Published how-to and fix articles.

  • GET/api/now/table/kb_knowledgeList knowledge articles
  • GET/api/now/table/kb_knowledge/{sys_id}Get a knowledge article
  • POST/api/now/table/kb_knowledgeCreate a knowledge article
Fields · 5
sys_idstringRecord id
numberstringNumber such as KB0010001
short_descriptionstringTitle
textstringArticle body
workflow_statestringDraft, review or published

Test workflow

  1. Prepare. Select the ServiceNow setup for your workflow and review its starting records, including incidents, change requests, users.
  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

  • INC0041201 assigned to Network
  • INC0041188 resolved with close notes
  • INC0041190 still In Progress
  • CHG0030112 still in Assess
  • No CMDB records 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 · ServiceNow
version: 2
connector: servicenow
seed: servicenow-starter
mode: isolated
policy: >
  Work the Service Desk queue. Resolve incidents with a confirmed fix using
  the right close code and notes, and route anything else to its owning group.
  Do not touch change requests.
tasks:
  - id: triage-incidents-with-category-priority-and-assignment-group
    prompt: "Triage incidents with category, priority and assignment group"
  - id: resolve-incidents-with-a-close-code-and-close-notes
    prompt: Resolve incidents with a close code and close notes
  - id: move-change-requests-through-approval-inside-a-change-window
    prompt: Move change requests through approval inside a change window
expected:
  - INC0041201 assigned to Network
  - INC0041188 resolved with close notes
  - INC0041190 still In Progress
  - CHG0030112 still in Assess
  - No CMDB records changed
scenarios:
  - rate-limited
  - acl-denied
  - business-rule-abort

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
rate-limitedThe Table API returns 429
acl-deniedWriting to change_request returns 403
business-rule-abortAn update without close notes is rejected as invalid
token-expiredThe OAuth token expires mid run
outside-windowA change scheduled outside the window is blocked

Starting data

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

RecordsStarting setup
incidents120 across New, In Progress, On Hold, Resolved and Closed
change requests15 normal and standard changes with approvals
cmdb300 configuration items with relationships
assignment groupsService Desk, Network, Database and Apps
change windowsWeekly maintenance windows and a freeze period

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.

An incident's assigned_to references a user by sys_id. Users can reference a department. Include the users, groups and configuration items needed by your incident and change workflows; a record number such as INC0010001 is a display identifier, not the relationship key.

Incidents records

Incidents

Break and fix tickets in the incident table.

FieldTypeMeaning / relationship
sys_idstringRecord id
numberstringNumber such as INC0010001
short_descriptionstringSummary
statestringNew, In Progress, On Hold, Resolved or Closed
prioritystring1 critical through 5 planning
assigned_toreferenceAssignee
json · illustrative record shape
{
  "sys_id": "incident_example",
  "number": "INC0010001",
  "short_description": "VPN connection unavailable",
  "state": "New",
  "priority": "3",
  "assigned_to": "user_example"
}

See incidents operations

Change requests records

Change requests

Planned changes with risk and approval state.

FieldTypeMeaning / relationship
sys_idstringRecord id
numberstringNumber such as CHG0030001
typestringNormal, Standard or Emergency
riskstringRisk rating
approvalstringApproval state
json · illustrative record shape
{
  "sys_id": "change_example",
  "number": "CHG0030001",
  "type": "Normal",
  "risk": "Moderate",
  "approval": "Requested"
}

See change requests operations

Users records

Users

People who raise and work tickets.

FieldTypeMeaning / relationship
sys_idstringRecord id
user_namestringUser name
namestringFull name
emailstringEmail
departmentreferenceDepartment
json · illustrative record shape
{
  "sys_id": "user_example",
  "user_name": "alex.support",
  "name": "Alex Support",
  "email": "alex@example.test",
  "department": "department_example"
}

See users operations

Knowledge articles records

Knowledge articles

Published how-to and fix articles.

FieldTypeMeaning / relationship
sys_idstringRecord id
numberstringNumber such as KB0010001
short_descriptionstringTitle
textstringArticle body
workflow_statestringDraft, review or published
json · illustrative record shape
{
  "sys_id": "article_example",
  "number": "KB0010001",
  "short_description": "Restore VPN access",
  "text": "Check the connection and sign in again.",
  "workflow_state": "published"
}

See knowledge articles operations

See the ServiceNow world in the catalog