Slack · API simulation

A Slack API mock that keeps state.

Test Slack bots and agents in seeded channels and threads, with state that changes as they act.

Run the example
Starting conversation and the expected replyA seeded support channel contains a newer invitation question and an older CSV export question. After the agent runs, the expected state has the invitation answer in the newer thread. #supportStarting state MMike13:58How do I invite a teammate? MMike13:25Where is the CSV export? Expected stateReply in the invite threadSettings → Members → Invite.Correct threadState check

Give the whole conversation to the test.

Channels with history.

Seed the questions, people and earlier replies your agent needs to see.

Replies that stay put.

A message written by the agent becomes part of the state for later calls.

A fresh start, each trial.

Rerun the scene from the same data to compare a change to your agent.

The right answer needs the right thread.

The task is to answer the newest question in #support. An older question about CSV exports distracts the bot, and it replies there instead. Both versions successfully post a message.

A check on the final thread catches the mistake. Change one line in the bot, keep the starting data and checks, and run the same scene again.

See how the scene was rebuilt
Thread-selection check3 trials / version
CheckOriginal botFixed bot
Posted a reply3 of 33 of 3
Answered the newest thread0 of 33 of 3

Recorded results from the supplied deterministic bot, with no LLM involved. This example checks thread selection, not model reliability.

Run a Slack test you can inspect.

The bot and scene include the conversation, the bug and the checks. Use Node.js 24 and CLI 0.1.6 to reproduce the recorded result.

Read the full walkthrough

Run the supplied bot.

Save both files in an empty directory. The correct-thread check should fail on the original bot.

npm install -g @ancha-labs/cli@0.1.6
ancha init --agent "node bot.mjs"
ancha scene validate scene.yaml
ancha run scene.yaml --local -n 3
ancha baseline save before

Change one line. Keep the test.

In bot.mjs, change messages.findLast( to messages.find(. Keep the scene and checks unchanged, then compare.

ancha run scene.yaml --local -n 3 --compare before

Local process mode does not block outbound network access. Use Ancha’s supplied Slack endpoint and test credentials.

Connect the client you already use.

Configure the Slack base URL and test credentials in your agent. Check its API calls against the supported subset before you run it.

@slack/bolt 5.1.0@slack/web-api 7.19.0
Slack connection guide
Slack Web API subset
22 HTTP endpoints
Objects in the environment
Channels, People, Messages
SDK compatibility
The versions listed here are tested against the supported operations.

Bot-token API subset; no general Slack workspace clone.

Connection variables

SLACK_API_URL SLACK_BOT_TOKEN SLACK_SIGNING_SECRET SLACK_APP_TOKEN

Explore all 22 supported endpoints

apps

POST/api/apps.connections.open

prepared or running socket-selected trials; app token only; one active socket, one-use 30s grant, 3s ACK timeout and one retry total including reconnect; 10s ping/30s pong deadline

auth

POST/api/auth.test

available during prepared-session SDK bootstrap; HTTP events require signed URL verification before the clock starts

chat

POST/api/chat.delete

emits message_deleted; deleting thread parents still lacks Slack tombstones

POST/api/chat.getPermalink
POST/api/chat.postMessage

error code unverified against real Slack; a user id as channel posts in the DM with that user; emits message events for bot-member channels and DMs (channel_type im); human actor mentions also emit app_mention; HTTP uses signed URL verification

POST/api/chat.update

text/blocks updates emit message_changed; metadata and attachments are explicit gaps

conversations

POST/api/conversations.create
POST/api/conversations.history
POST/api/conversations.info
POST/api/conversations.join
POST/api/conversations.list

types im lists the caller's direct messages; mpim is accepted and matches nothing: multi-person DMs are not modeled

POST/api/conversations.members
POST/api/conversations.open

one user (a DM, created on first use) or an existing DM channel; return_im and prevent_creation; multi-person DMs are a gap

POST/api/conversations.replies

reactions

POST/api/reactions.add

emits reaction_added for bot-member channels; scripted slack.react uses the same mutation

POST/api/reactions.get
POST/api/reactions.remove

emits reaction_removed for bot-member channels

search

POST/api/search.messages

user tokens arrive in a later plan

users

POST/api/users.conversations

types im lists the caller's direct messages; mpim is accepted and matches nothing: multi-person DMs are not modeled

POST/api/users.info
POST/api/users.list
POST/api/users.lookupByEmail

Questions about testing Slack.

Open the Slack docs
What is a stateful Slack API mock?

A stateful Slack API mock keeps data between calls. If your agent posts a message, a later read can see that message. Ancha supplies a documented Slack Web API subset with seeded channels, users and threads, so tests can inspect what the agent changed.

How can I test a Slack bot without a real workspace?

Point the bot at Ancha’s Slack endpoint and use the supplied test credentials. Define the channel data in a scene, run the bot, and check the resulting messages. The downloadable example needs no real Slack workspace, Slack API key or model.

How is this different from mocking the Slack SDK?

An SDK mock helps test your own handlers by replacing client methods. Ancha provides an API endpoint backed by shared state, so successive reads and writes can be tested together. You can use SDK mocks for focused unit tests and Ancha for the supported multi-call workflow.

Can I use Slack Bolt or @slack/web-api?

The catalog records tests with @slack/bolt 5.1.0 and @slack/web-api 7.19.0. Configure the client to use the environment’s Slack base URL and credentials; the connection guide covers the settings. Compatibility is limited to the documented API operations, rather than every Slack feature or SDK version.

Which Slack API endpoints are supported?

The current catalog lists 22 HTTP endpoints, including conversations.history, conversations.replies and chat.postMessage. The coverage list on this page is generated from that catalog, including operation-specific gaps. Ancha is not a full copy of Slack.

Can I recreate a failed Slack run from a trace?

Use recorded reads and writes to write the scene’s starting state, then supply missing context such as channel membership. Keep replies that arrived later out of the initial data. You describe the reconstruction yourself; direct import from tracing tools is not available.

Is this the same as a Slack developer sandbox?

Slack’s developer sandboxes are provided by Slack. Ancha is an independent simulation of a documented API subset, designed for seeded, repeatable agent tests. Use a real Slack environment when you need to validate behavior outside that subset.

Will this send messages to a real Slack workspace?

The simulated Slack service keeps messages inside the world. Your agent must use the supplied endpoint and test credentials. Local process mode does not block outbound network access; use the documented isolated execution modes when you need a network boundary.

Guides for the next step.

Test the conversation before it reaches a customer.

Start with the example, or talk through your agent’s workflow.

Book a demo

Ancha is an independent simulation environment and is not affiliated with Slack.