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

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.

bindingmeaning
WORLDS_SLACK_URLThis world's origin followed by /api
WORLDS_API_KEYThe world key, accepted wherever Slack expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · @slack/web-api
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
tsstringMessage timestamp, also its id
channelstringChannel id
textstringMessage text
userstringAuthor user id
thread_tsstringParent 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
idstringChannel id
namestringChannel name
is_privatebooleanPrivate channel
num_membersintegerMember count
topicobjectTopic

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
idstringUser id
namestringHandle
real_namestringFull name
profileobjectEmail, title and status
deletedbooleanDeactivated

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
namestringEmoji name
countintegerNumber of reactions
usersarrayUsers who reacted
channelstringChannel of the message

Test workflow

  1. Prepare. Select the Slack setup for your workflow and review its starting records, including messages, conversations, 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

  • 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.

yaml · worlds/tasks.yaml
# 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
  - archived

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-limitedchat.postMessage returns 429 with Retry-After
not-in-channelPosting to a channel the bot hasn't joined returns not_in_channel
archivedPosting to an archived channel returns is_archived
token-revokedCalls return token_revoked mid run
event-twiceThe 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.

RecordsStarting setup
channels30 public and private channels, some archived
messages2,000 messages with threads and reactions
users80 members, guests and bots
user groups@oncall, @it-team and @finance
policiesWho 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.

FieldTypeMeaning / relationship
tsstringMessage timestamp, also its id
channelstringChannel id
textstringMessage text
userstringAuthor user id
thread_tsstringParent message for replies
json · illustrative record shape
{
  "ts": "<Message timestamp, also its id>",
  "channel": "<Channel id>",
  "text": "<Message text>",
  "user": "<Author user id>",
  "thread_ts": "<Parent message for replies>"
}

See messages operations

Conversations records

Conversations

Public and private channels, DMs and group DMs.

FieldTypeMeaning / relationship
idstringChannel id
namestringChannel name
is_privatebooleanPrivate channel
num_membersintegerMember count
topicobjectTopic
json · illustrative record shape
{
  "id": "<Channel id>",
  "name": "<Channel name>",
  "is_private": false,
  "num_members": 1,
  "topic": {}
}

See conversations operations

Users records

Users

Workspace members and their profiles.

FieldTypeMeaning / relationship
idstringUser id
namestringHandle
real_namestringFull name
profileobjectEmail, title and status
deletedbooleanDeactivated
json · illustrative record shape
{
  "id": "<User id>",
  "name": "<Handle>",
  "real_name": "<Full name>",
  "profile": {},
  "deleted": false
}

See users operations

Reactions records

Reactions

Emoji reactions on messages.

FieldTypeMeaning / relationship
namestringEmoji name
countintegerNumber of reactions
usersarrayUsers who reacted
channelstringChannel of the message
json · illustrative record shape
{
  "name": "<Emoji name>",
  "count": 1,
  "users": [],
  "channel": "<Channel of the message>"
}

See reactions operations

See the Slack world in the catalog