Slack API · error code

Slack error token_expired: Token has expired

ConfigurationHTTP 200Tokens & authentication

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
Authentication token has expired

What error token_expired means

The token was valid, but its lifetime ran out. Slack's reference description is simply "Authentication token has expired". You will only ever see this if your app uses expiring credentials — most commonly token rotation, where access tokens are short-lived and must be exchanged for new ones using a refresh token before they lapse. Apps using classic non-expiring tokens never encounter it; if you are seeing it and did not knowingly opt into rotation, some part of your install flow did.

The failure mode is almost always the refresh machinery, not Slack. Typical patterns: the refresh job silently stopped (crashed cron, paused queue), the refresh succeeded but the new token was written to one store while workers read from another, or clock skew let a token be used a few seconds past its expiry under load. Unlike token_revoked this state is self-inflicted and fully recoverable without a human: exchange the refresh token, store the new pair, retry the original call.

Handle it as a one-shot refresh-and-retry: on token_expired, run the refresh exchange, persist atomically, and retry the failed request once. If the refresh itself fails, escalate to the re-install path, because a lapsed refresh token cannot be revived.

What it looks like

{"ok": false, "error": "token_expired"}

Why it happens

  • Token rotation is enabled and the scheduled refresh did not run before the access token's expiry.
  • The refreshed token was stored in one place (database) while a worker kept using a stale in-memory copy.
  • The refresh token itself lapsed after the app went unused past its validity window.
  • Deploy or restart timing raced the refresh: the process booted with the previous, already-expired token.

How to fix Slack error token_expired

  1. 1Exchange the refresh token for a new access token via oauth.v2.access with grant_type=refresh_token, and persist both new values atomically.
  2. 2Retry the original API call once with the fresh token; do not loop.
  3. 3Audit every consumer of the token to make sure all read from the same store the refresher writes to, and invalidate in-memory caches on refresh.
  4. 4If the refresh exchange fails too, re-run the full install flow to issue a new token pair.
  5. 5Add monitoring on token age: alert when an access token is within a safety margin of expiry without a successful refresh recorded.

How to stop it recurring

Refresh proactively on a schedule comfortably inside the token lifetime rather than reactively on failure, and treat token_expired in production as a signal that the scheduler failed. Keep exactly one writer and one source of truth for the credential pair. If your app has no reason to use rotation, use classic non-expiring bot tokens and this error disappears from your vocabulary.

Official reference: Slack API reference - chat.postMessage errors. See all Slack error codes or the Slack limits and quotas.

Related codes

Error token_expired - quick answers

What does Slack error token_expired mean?

The token was valid, but its lifetime ran out. Slack's reference description is simply "Authentication token has expired". You will only ever see this if your app uses expiring credentials — most commonly token rotation , where access tokens are short-lived and must be exchanged for new ones using a refresh token before they lapse.

How do I fix Slack error token_expired?

1. Exchange the refresh token for a new access token via oauth.v2.access with grant_type=refresh_token, and persist both new values atomically. 2. Retry the original API call once with the fresh token; do not loop. 3. Audit every consumer of the token to make sure all read from the same store the refresher writes to, and invalidate in-memory caches on refresh. 4. If the refresh exchange fails too, re-run the full install flow to issue a new token pair. 5. Add monitoring on…

Stop debugging Slack by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.