Slack · api · fg-0362

Slack bot token stops working after 12 hours once token rotation is turned on

If you see token_expired from every Web API call about 12 hours after install, the cause and the fix for Slack are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
token_expired from every Web API call about 12 hours after installRefresh fails with invalid_refresh_token after reusing an old refresh tokenToken rotation toggle cannot be switched back off
Cause
With rotation on, access tokens expire after 43,200 seconds and each refresh returns a new single-use refresh token that replaces the old one. Rotation cannot be disabled once enabled.
Fix
Store the new refresh token from every oauth.v2.access refresh, refresh before expires_in, and keep tokens in a shared database store with refreshes serialized so two workers never redeem the same token. Try rotation in a development app first.
Apply
r = client.oauth_v2_access(client_id=cid, client_secret=cs, grant_type="refresh_token", refresh_token=stored) save(access=r["access_token"], refresh=r["refresh_token"], expires_at=now + r["expires_in"] - 300)
Affected
Slack apps with token rotation enabled, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun