Slack error invalid_refresh_token: Refresh token is invalid
Last verified against Slack API reference - chat.postMessage errors
The given refresh token is invalid.What error invalid_refresh_token means
Your app uses token rotation, and the refresh_token you sent with grant_type=refresh_token to oauth.v2.access was rejected: "The given refresh token is invalid." Without a valid refresh token you cannot get a new access token, and API calls will start failing with token_expired.
Slack's token rotation guide explains why refresh tokens go stale. With rotation on, access tokens expire every 12 hours (expires_in is 43200). Each refresh returns a new access token and a new refresh token; the guide says the old refresh token "is then revoked, and a new refresh token is used" next time. If your code saves only the new access token and keeps the old refresh token, the next refresh fails.
Race conditions cause the same failure. Two workers refreshing the same installation at once both send the same refresh token; one wins and the other's token is already spent. Uninstalls and revocations also invalidate it.
What it looks like
POST /api/oauth.v2.access
grant_type=refresh_token&refresh_token=xoxe-1-...
{"ok": false, "error": "invalid_refresh_token"}Why it happens
- The new refresh token from the previous refresh was not saved; the old one was reused.
- Concurrent workers refreshed the same installation with the same refresh token.
- The refresh token belongs to a different app or workspace than the credentials sent.
- The app was uninstalled or its tokens were revoked.
How to fix Slack error invalid_refresh_token
- 1On every refresh, save the new access_token, refresh_token and expiry together in one write.
- 2Serialize refreshes per installation with a lock so only one runs at a time.
- 3Refresh a little before expiry rather than after calls start failing.
- 4If the stored refresh token is unrecoverable, have a workspace user reinstall the app.
How to stop it recurring
Treat each refresh token as single-use: store the token pair atomically, guard refreshes with a per-installation lock, and alert on this error, since recovery needs a reinstall. Slack notes rotation cannot be turned off once enabled, so test this path in a development app first.
Official reference: Slack API reference - chat.postMessage errors. See all Slack error codes or the Slack limits and quotas.
Related codes
- token_expired: Token has expiredAuthentication token has expired
- token_revoked: Token has been revokedAuthentication token is for a deleted user or workspace or the app has been…
- invalid_auth: Authentication cannot be validatedSome aspect of authentication cannot be validated. Either the provided token…
- bad_client_secret: client_secret is invalidValue passed for client_secret was invalid.
Error invalid_refresh_token - quick answers
What does Slack error invalid_refresh_token mean?
Your app uses token rotation, and the refresh_token you sent with grant_type=refresh_token to oauth.v2.access was rejected: "The given refresh token is invalid." Without a valid refresh token you cannot get a new access token, and API calls will start failing with token_expired . Slack's token rotation guide explains why refresh tokens go stale.
How do I fix Slack error invalid_refresh_token?
1. On every refresh, save the new access_token, refresh_token and expiry together in one write. 2. Serialize refreshes per installation with a lock so only one runs at a time. 3. Refresh a little before expiry rather than after calls start failing. 4. If the stored refresh token is unrecoverable, have a workspace user reinstall the app.
Stop debugging Slack by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.