Slack API · error code

Slack error missing_scope: Token lacks a required OAuth scope

ConfigurationHTTP 200Scopes, permissions & admin policy

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
The token used is not granted the specific scope permissions required to complete this request.

What error missing_scope means

The token is valid and the request is well-formed, but the token was never granted the OAuth scope this method requires. Slack's description: "The token used is not granted the specific scope permissions required to complete this request." It is the most self-diagnosing error on the platform, because the response body goes beyond the string and names names: a needed field lists the scope the method wants, and a provided field lists every scope your token actually carries. Code that logs only error throws that diagnosis away.

The trap is not reading the error — it is what comes after. Scopes are baked into the token at install time. Adding chat:write to your app's scope list under OAuth & Permissions changes what the next issued token will carry; it does nothing to the token your production system already holds. Developers add the scope, see the error persist, and conclude the fix failed. The missing step is reinstalling the app to the workspace, which issues a fresh token containing the new scope, and then deploying that fresh token. Both halves are required: reinstall without updating the stored secret keeps the old token in play, and for internal apps the token string on the OAuth & Permissions page is silently replaced after reinstall.

Two adjacent errors are worth separating. no_permission is about what the token's identity can do in context (typically posting where the bot is not a member), and not_allowed_token_type means the entire class of token is wrong for the method regardless of scopes. If needed already appears inside provided and you still get missing_scope, check that you are sending the token you think you are — bot vs. user token mixups produce exactly that head-scratcher, since bot and user scopes are granted independently.

SDK surfacing is standard: @slack/web-api rejects with ErrorCode.PlatformError and error.data.needed / error.data.provided intact; slack_sdk raises SlackApiError where e.response["needed"] is readable alongside e.response["error"]. Log both fields on every occurrence.

What it looks like

{
  "ok": false,
  "error": "missing_scope",
  "needed": "chat:write",
  "provided": "channels:read,users:read"
}

Why it happens

  • The scope required by the method was never added to the app's OAuth scope list.
  • The scope was added in the app config, but the app was not reinstalled, so the live token predates the change.
  • The app was reinstalled but the newly issued token never reached production; the old token is still deployed.
  • The request uses the bot token where the granted scope lives on the user token, or vice versa — the two scope sets are independent.
  • A granular scope was assumed transitive (e.g. expecting chat:write to imply reading history, which needs channels:history and friends).

How to fix Slack error missing_scope

  1. 1Read needed and provided from the response body; needed is the exact scope string to add.
  2. 2Add that scope under your app's OAuth & Permissions page (bot token scopes for xoxb- tokens, user token scopes for xoxp-).
  3. 3Reinstall the app to the workspace so a new token is issued with the added scope.
  4. 4Copy the newly issued token into your secret store and redeploy or restart consumers so no process keeps the pre-reinstall token.
  5. 5Confirm with auth.test plus a retry of the original call; needed/provided will have disappeared along with the error.

How to stop it recurring

Decide the app's full scope list before the first install rather than accreting scopes one incident at a time, and write the reinstall-then-rotate-secret procedure into your runbook as a single atomic change. In development, keep a checklist mapping each API method you call to the scope it needs — every method's reference page states it. The scope-vs-membership distinction is walked through in Slack bot not responding.

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

Related codes

Error missing_scope - quick answers

What does Slack error missing_scope mean?

The token is valid and the request is well-formed, but the token was never granted the OAuth scope this method requires.

How do I fix Slack error missing_scope?

1. Read needed and provided from the response body; needed is the exact scope string to add. 2. Add that scope under your app's OAuth & Permissions page (bot token scopes for xoxb- tokens, user token scopes for xoxp-). 3. Reinstall the app to the workspace so a new token is issued with the added scope. 4. Copy the newly issued token into your secret store and redeploy or restart consumers so no process keeps the pre-reinstall token. 5. Confirm with auth.test plus a retry of…

Stop debugging Slack by hand

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