Worlds / Comms and scheduling
Slack API
A local Slack workspace with channels, threads, users, mentions and workspace policies. Test the agent that answers in threads, routes requests and posts updates in the right place.
- Base path
/api- Auth
- Bot or user OAuth token, the world key
- Endpoints
- 16
- Status
- Active today
This reference previews the surface the Slack world serves in the closed beta. Paths mirror the public Slack 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.
| binding | meaning |
|---|---|
WORLDS_SLACK_URL | This world's origin followed by /api |
WORLDS_API_KEY | The world key, accepted wherever Slack expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
import { WebClient } from "@slack/web-api";
const slack = new WebClient(process.env.WORLDS_API_KEY, {
slackApiUrl: process.env.WORLDS_SLACK_URL + "/api/",
});
const res = await slack.chat.postMessage({
channel: "C0123456789",
text: "Deploy finished",
});API reference
Messages
Posts in channels and threads.
- POST
/api/chat.postMessagePost a message - POST
/api/chat.updateUpdate a message - POST
/api/chat.deleteDelete a message - GET
/api/conversations.historyFetch channel history - GET
/api/conversations.repliesFetch a thread's replies
Fields · 5
ts | string | Message timestamp, also its id |
channel | string | Channel id |
text | string | Message text |
user | string | Author user id |
thread_ts | string | Parent message for replies |
Conversations
Public and private channels, DMs and group DMs.
- GET
/api/conversations.listList conversations - POST
/api/conversations.createCreate a channel - POST
/api/conversations.joinJoin a channel - POST
/api/conversations.inviteInvite users to a channel - GET
/api/conversations.membersList channel members
Fields · 5
id | string | Channel id |
name | string | Channel name |
is_private | boolean | Private channel |
num_members | integer | Member count |
topic | object | Topic |
Users
Workspace members and their profiles.
- GET
/api/users.listList users - GET
/api/users.infoGet a user - GET
/api/users.lookupByEmailFind a user by email
Fields · 5
id | string | User id |
name | string | Handle |
real_name | string | Full name |
profile | object | Email, title and status |
deleted | boolean | Deactivated |
Reactions
Emoji reactions on messages.
- POST
/api/reactions.addAdd a reaction - POST
/api/reactions.removeRemove a reaction - GET
/api/reactions.getGet reactions for a message
Fields · 4
name | string | Emoji name |
count | integer | Number of reactions |
users | array | Users who reacted |
channel | string | Channel of the message |
Test workflow
- Prepare. Select the Slack setup for your workflow and review its starting records, including messages, conversations, users.
- 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.
- Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
- 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
- Replies posted in each reporter's thread
- One status message in #incidents
- No @channel or @here used
- No channels archived or created
- No messages sent as DMs
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.
# worlds/tasks.yaml · Slack
version: 2
connector: slack
seed: slack-starter
mode: isolated
policy: >
Answer VPN reports in #it-helpdesk in their threads and post one status
update in #incidents. Do not use @channel or @here.
tasks:
- id: answer-requests-in-the-thread-they-came-from
prompt: Answer requests in the thread they came from
- id: route-a-request-to-the-owning-channel
prompt: Route a request to the owning channel
- id: post-incident-updates-without-paging-everyone
prompt: Post incident updates without paging everyone
expected:
- "Replies posted in each reporter's thread"
- "One status message in #incidents"
- "No @channel or @here used"
- No channels archived or created
- No messages sent as DMs
scenarios:
- rate-limited
- not-in-channel
- archivedSee 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.
| condition | what the agent sees |
|---|---|
rate-limited | chat.postMessage returns 429 with Retry-After |
not-in-channel | Posting to a channel the bot hasn't joined returns not_in_channel |
archived | Posting to an archived channel returns is_archived |
token-revoked | Calls return token_revoked mid run |
event-twice | The message event is delivered two times |
Starting data
Start each run from the same records and relationships. The overview below describes the Slack starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| channels | 30 public and private channels, some archived |
| messages | 2,000 messages with threads and reactions |
| users | 80 members, guests and bots |
| user groups | @oncall, @it-team and @finance |
| policies | Who can use @channel and post in announcements |
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.
Messages records
Messages
Posts in channels and threads.
| Field | Type | Meaning / relationship |
|---|---|---|
ts | string | Message timestamp, also its id |
channel | string | Channel id |
text | string | Message text |
user | string | Author user id |
thread_ts | string | Parent message for replies |
{
"ts": "<Message timestamp, also its id>",
"channel": "<Channel id>",
"text": "<Message text>",
"user": "<Author user id>",
"thread_ts": "<Parent message for replies>"
}Conversations records
Conversations
Public and private channels, DMs and group DMs.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | Channel id |
name | string | Channel name |
is_private | boolean | Private channel |
num_members | integer | Member count |
topic | object | Topic |
{
"id": "<Channel id>",
"name": "<Channel name>",
"is_private": false,
"num_members": 1,
"topic": {}
}Users records
Users
Workspace members and their profiles.
| Field | Type | Meaning / relationship |
|---|---|---|
id | string | User id |
name | string | Handle |
real_name | string | Full name |
profile | object | Email, title and status |
deleted | boolean | Deactivated |
{
"id": "<User id>",
"name": "<Handle>",
"real_name": "<Full name>",
"profile": {},
"deleted": false
}Reactions records
Reactions
Emoji reactions on messages.
| Field | Type | Meaning / relationship |
|---|---|---|
name | string | Emoji name |
count | integer | Number of reactions |
users | array | Users who reacted |
channel | string | Channel of the message |
{
"name": "<Emoji name>",
"count": 1,
"users": [],
"channel": "<Channel of the message>"
}