Slack API · error code

Slack error team_access_not_granted: Token not granted access to this workspace

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 workspace access required to complete this request.

What error team_access_not_granted means

The token is valid but has no grant for the workspace the request touches. Slack's description: "The token used is not granted the specific workspace access required to complete this request." This is an Enterprise Grid organism: org-wide installed apps hold org-level tokens whose access is then scoped to particular workspaces within the organization, and calling into a workspace outside that grant lands here.

Concretely, org-installed apps often need to be granted access workspace by workspace (or use admin.teams.*-style flows to expand coverage), and channels live in specific workspaces. A bot that works perfectly in three workspaces of a Grid org and fails in the fourth with team_access_not_granted has simply never been granted the fourth. It also appears when an app caches a channel-to-workspace mapping that a migration has since invalidated.

The resolution is administrative: the org admin adds the app to the missing workspace (or your install flow requests it), after which the same token starts working there. In code, the useful move is to record which team ID each conversation belongs to, so the error can be attributed to the right workspace instantly.

What it looks like

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

Why it happens

  • The app is org-installed but was never granted access to the specific workspace containing the target conversation.
  • A channel moved between workspaces (or a workspace was added to the org) after your app cached its location.
  • The request supplies a team ID that the token's grant does not cover.

How to fix Slack error team_access_not_granted

  1. 1Identify the workspace that owns the target conversation (team_id on the conversation object).
  2. 2Have an org admin grant the app access to that workspace via the organization's app management.
  3. 3If your install flow supports it, request access to the additional workspace programmatically and re-run the grant.
  4. 4Retry the call once the grant exists; the token itself does not change.

How to stop it recurring

For Enterprise Grid deployments, track the set of workspaces the app is granted per organization and reconcile it against where users try to use the bot; surface a "this workspace hasn't enabled the app yet" message with an admin-facing grant link instead of a generic failure.

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

Related codes

Error team_access_not_granted - quick answers

What does Slack error team_access_not_granted mean?

The token is valid but has no grant for the workspace the request touches. Slack's description: "The token used is not granted the specific workspace access required to complete this request." This is an Enterprise Grid organism: org-wide installed apps hold org-level tokens whose access is then scoped to particular workspaces within the organization, and calling into a workspace outside that grant lands here.

How do I fix Slack error team_access_not_granted?

1. Identify the workspace that owns the target conversation (team_id on the conversation object). 2. Have an org admin grant the app access to that workspace via the organization's app management. 3. If your install flow supports it, request access to the additional workspace programmatically and re-run the grant. 4. Retry the call once the grant exists; the token itself does not change.

Stop debugging Slack by hand

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