Connect Slack to a tool built with Claude or ChatGPT (2026)
Your tool built with Claude needs to alert the team in Slack: a signed quote, low stock, a request to approve. The reflex is to paste the Slack token into the code, where it ends up leaking. On while, it stays in while, and your AI never sees it. Here is how, in about ten minutes.
By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 18, 2026.
A tool built with Claude or ChatGPT reaches another level when it alerts the team where it already is, in Slack. A signed quote, stock that drops below the threshold, an expense report waiting for approval: the team sees it right away. To post, the tool needs a Slack token. That is where things often go wrong: the token ends up pasted into the code, then pushed to GitHub. Slack revokes it when it finds it3, and the tool goes silent without telling anyone.
On while, the Slack token stays in while. The tool posts without ever holding it, and your AI never sees it.
The short version. Create an app at api.slack.com/apps, give it the chat:write scope, install it and copy its bot token, which starts with xoxb-. Ask your AI to connect Slack, then paste the token into while through the link it gives you. The tool posts in your channels, and every call is logged.
Webhook or bot token: which one to choose
Slack offers two ways to have a tool post, and they do not serve the same purpose.
| Incoming webhook | Bot token | |
|---|---|---|
| What it allows | Posting in a single channel | Posting in chosen channels, reading depending on scopes |
| Where the secret lives | In the webhook URL | In the token, on its own |
| What it is tied to | One channel and the person who created it | The app, whoever the person is |
| Our advice on while | For a quick test | For a team tool |
The webhook is quick: one URL, one channel3. The bot token is more flexible, it does not depend on the person who installed it, and it stays valid when they leave the company2.
Connect Slack to your tool, in four steps
The whole thing takes about ten minutes, and you have no code to write.
- Create an app in Slack. At api.slack.com/apps, click Create New App, give it a name, the one that will sign the messages, and choose your workspace1.
- Give it the right to post. Under OAuth & Permissions, in Bot Token Scopes, add chat:write. Add chat:write.public if the bot should post in every public channel without being added to it1.
- Install it and copy the token. Click Install to Workspace, then go back to OAuth & Permissions. The bot token, which starts with xoxb-, shows there1,2.
- Paste the token into while. Ask your AI to connect Slack. It declares the connection and gives you a link, where you paste the token. Neither your AI nor the tool’s code sees it.
For a private channel, add the bot to the channel with the /invite @bot-name command1. If your Workspace Owners have turned on app approval, the installation in step 3 waits for their approval4.
You, to your AI: Connect Slack to this tool, and post in the #orders channel every time an order goes over $5,000.

What while does on each call
The tool calls Slack through while, without a token. while adds the bot token to each call, and logs it in the history. For the first seven days, reads go through and teach while what the tool calls. Posting a message is a write: it goes through once you approve its rule. After that, an unexpected call is refused, and your AI is told.
You can also ask for your approval before a sensitive call.
You, to your AI: Ask me before the tool posts in the #general channel.
The credentials of your software are detailed on our security page, and the same mechanism works for any API in connect an API with no credentials in the code.
Changing the token
If the token leaks or you recreate the app, Slack gives you a new one under OAuth & Permissions. Paste it into while: the tool uses it from the next call, without being put back in place, and your AI has nothing to redo.
What while adds around it
- Your colleagues use the tool with a while account for up to 3 people, or, on the Pro plan, with their email account, Google or Microsoft. See keep a tool for your colleagues.
- Connected software: one on the Libre plan, and 25 on the Pro plan, Slack included.
- The tool’s data is backed up every day, and your tools are hosted in France by Nextmap.
For stock alerts ready to post, see the inventory tracker with alerts, and for related connections, connect HubSpot and connect Google Sheets.
Try it with your tool
Give this message to your AI, then ask it to connect Slack. The trial is free, with no sign-up, and your tool has its address in 3 minutes.
Read while.sh/agents and help me get started with while.
In the docs: Variables and secrets.
Sources
- Slack, Quickstart with app settings, accessed November 18, 2026
- Slack, Tokens, accessed November 18, 2026
- Slack, Sending messages using incoming webhooks, accessed November 18, 2026
- Slack, Manage app approval for your workspace, accessed November 18, 2026