Keys / Slack

SLACK_BOT_TOKEN

The bot token your Slack app calls the Web API with. Slack issues it when you install the app in a workspace.

Starts with
xoxb-
Expires
never, or every 12 hours with token rotation
API
issued by the OAuth install (oauth.v2.access), revoked with auth.revoke

Get it

Create one on api.slack.com/apps. The steps aren't recorded yet.

Set it

SLACK_BOT_TOKEN=xoxb-...

Bolt for Python and Bolt for Java read it from this variable when you don't pass a token. Bolt for JavaScript and the Node.js and Python SDKs don't; your app passes it in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. In your app's settings, click Revoke all tokens, or call auth.revoke with the bot token. The old token stops working at once, and Slack removes the bot from its channels.
  2. Reinstall the app from the Install App page, copy the new Bot User OAuth Token and deploy it everywhere that reads SLACK_BOT_TOKEN.
  3. Invite the bot back to the channels it needs, including private ones, and check that it can post there.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16