Getting started
Make a bot, copy its token, add it to a channel and post. Then point Slack’s Bolt at Instant and you have a bot that listens and answers.
1. Make the Bot
In Instant, open Settings › Bots & Apps and choose New Bot. Give it a name and a one-line description. It gets a generated face; upload a picture whenever you like.
You need the Manage Bots and Apps permission. Owners and admins have it, and they can give it to anyone in Settings › Roles. A bot takes a seat like a person, because it reads and posts like one.
2. Copy the Token
The token starts with ib_ and shows once, so copy it now. The signing secret is beside it; you can show it again later. Keep both out of your code:
export INSTANT_BOT_TOKEN=ib_…
export INSTANT_SIGNING_SECRET=…Lost the token? Make a new one on the bot’s page. A bot keeps two live tokens, so you can switch over before revoking the old one.
3. Add It to a Channel
Bots only see channels someone adds them to. Type /invite @Your Bot in a channel, or use Add to Channels on the bot’s page. Anyone can DM a bot without adding it anywhere.
4. Post a Message
Instant speaks Slack’s Web API at https://api.instant.im/api/. A channel’s id is the last part of its address in the web app (instant.im/w/your-team/c/ch_…), or ask conversations.list for the channels your bot is in. Then:
curl https://api.instant.im/api/chat.postMessage \
-H "Authorization: Bearer $INSTANT_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel": "ch_…", "text": "Hello from my bot"}'The answer is Slack’s: {"ok": true, "channel": "ch_…", "ts": "msg_…", "message": {…}}. The message shows at once for everyone in the channel, under your bot’s name with a Bot badge.
5. Listen and Answer with Bolt
Slack’s SDKs work as they are: give them the Instant token and Instant’s API URL. This bot answers anyone who mentions it, in a thread:
npm install @slack/boltapp.js
import bolt from '@slack/bolt';
const app = new bolt.App({
token: process.env.INSTANT_BOT_TOKEN,
signingSecret: process.env.INSTANT_SIGNING_SECRET,
clientOptions: { slackApiUrl: 'https://api.instant.im/api/' },
});
app.event('app_mention', async ({ event, say }) => {
await say({ thread_ts: event.ts, text: `Hi <@${event.user}>!` });
});
await app.start(3000);Bolt listens at /slack/events. On the bot’s page, set the Events URL to that address on your server (for example https://bot.example.com/slack/events) and tick app_mention. Instant checks the URL with Slack’s url_verification challenge when you save it, which Bolt answers for you.
Two APIs, One Token
- Slack-compatible methods at
https://api.instant.im/api/<method>, for bots written for Slack. Form fields or JSON in, Slack’s{"ok": …}out. - Instant’s own REST API at
https://api.instant.im/v1, the one the apps use, limited to what the bot’s scopes allow. JSON in and out, errors as{"error": {"code", "message"}}.
Most bots only need the first. Next, see what a token may do in Tokens and Scopes.