---
title: "Rotating a Slack API Token After It's Been Exposed"
url: "/help/buuk/rotating-a-slack-api-token-after-its-been-exposed"
updated: "2026-11-04T08:49:20.140Z"
---
# Rotating a Slack API Token After It's Been Exposed

If a Slack API token has been shared accidentally — pasted into a screenshot, committed to a public repo, or posted in a channel — treat it as compromised immediately. A token that leaks out of your control can be used by anyone to call the Slack API as your app, regardless of whether you also create a new one. This article covers how to revoke the exposed token, generate its replacement, and update every integration that depends on it.

## Revoke first, then replace — do both

Generating a new token does **not** automatically disable the old one. Slack tokens remain valid until they are explicitly revoked, so creating a replacement without revoking the leaked token leaves two working credentials in circulation — the new one you control, and the old one anyone who saw the screenshot can still use.

The correct order is:

1. Revoke the exposed token.
2. Generate a new token for the app.
3. Update every integration, script, or service that referenced the old token.

Because revoking a token breaks every integration using it at that moment, do steps 1 and 2 back-to-back and have your list of integrations ready before you start, so the gap between revoking and redeploying the new token is as short as possible.

## Step 1: Revoke the exposed token

1. Go to [api.slack.com/apps](https://api.slack.com/apps) and sign in with the account that manages the app.
2. Select the app whose token was exposed.
3. In the left sidebar, open **OAuth & Permissions**.
4. Locate the token that matches the one shown in the screenshot (Bot User OAuth Token or User OAuth Token).
5. Use the option to revoke the app's OAuth tokens. This immediately invalidates the exposed credential — any request made with it will start failing right away.

If you're not sure which app or workspace the token belongs to, don't wait to confirm before acting. A token that no longer works can be re-issued; a token that keeps working while exposed cannot be "un-leaked."

If you don't have owner or admin access to the app's configuration, contact your Slack workspace administrator to revoke the token on your behalf.

## Step 2: Generate the replacement token

1. Still in **OAuth & Permissions** for the app, reinstall the app to your workspace (or trigger a new installation if prompted). This step generates a fresh Bot User OAuth Token (and User OAuth Token, if your app requests user scopes).
2. Copy the new token immediately and store it in a secure location — a secrets manager, encrypted environment variable store, or your team's credential vault. Avoid pasting it into chat messages, tickets, or documents that could be screenshotted again.
3. Confirm the scopes attached to the new token match what your integrations actually need. A token rotation is a good moment to remove scopes the app no longer uses, rather than carrying forward overly broad permissions from the original setup.

## Step 3: Update each integration

Every system that stored the old token needs the new one before it will work again. Go through each integration individually:

- **Backend services and scripts** — Update the environment variable, config file, or secrets manager entry that holds the token, then redeploy or restart the service so it picks up the new value.
- **CI/CD pipelines** — Update the stored secret in your pipeline's secrets settings (for example, a repository or organization secret).
- **Third-party tools connected via Slack app** (bots, webhooks consumers, internal dashboards) — Update the credential field in each tool's settings where the Slack token is entered.
- **Local development environments** — Anyone on the team running the integration locally needs to replace their local copy of the token as well; the leaked value should be treated as permanently invalid everywhere.

Keep a simple checklist of every place the token lives before you start rotating — this is the step most likely to cause an outage if something is missed, since the old token stops working the moment it's revoked.

## Step 4: Confirm everything is working

After updating each integration:

1. Trigger a test action in each system (send a test message, run a scheduled job manually, or check the integration's own status page) to confirm it authenticates successfully with the new token.
2. Check for any lingering references to the old token in logs, error messages, or failed-request alerts — these usually point to a config file or service that was missed in Step 3.
3. Once everything is confirmed working, delete or invalidate any local copies of the old token value (notes, chat history, screenshots) that may still exist.

## Troubleshooting

**An integration is failing with an authentication error after rotation.**

Confirm the integration is using the newly generated token and not a cached or previously stored value. Some services cache credentials in memory and need a restart, not just a config update.

**I revoked the token but I'm not sure every integration was updated.**

Check each integration's activity or error logs for authentication failures starting at the time of revocation — that's a reliable way to find anything still pointing at the old token.

**I don't have access to revoke the app's tokens.**

Contact your Slack workspace administrator or the app's owner. Revocation and reinstallation both require admin-level access to the app's configuration.

## FAQ

**Will my integrations keep working during rotation?**

No. Revoking the old token stops it from working immediately, and each integration stays broken until it's updated with the new token. Plan the rotation for a time when a short interruption is acceptable, and have the new token ready to deploy right after revoking the old one.

**Do I need to revoke the old token if I'm already generating a new one?**

Yes. Generating a new token does not disable the old one. If the old token isn't revoked, it remains usable by anyone who has it, even after you start using the new one.

**How often should API tokens be rotated as routine practice?**

Beyond emergency rotations after exposure, periodically rotating tokens limits how long any undetected leak stays useful to an attacker. Set a cadence that fits your organization's security policy.