Slack API · error code

Slack error not_in_channel: Bot is not a member of the channel

ConfigurationHTTP 200Channels, membership & DMs

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
Cannot post user messages to a channel they are not in.

What error not_in_channel means

The channel resolved — Slack knows exactly which conversation you mean — but the identity behind your token is not a member of it, and the operation requires membership. The chat.postMessage description reads "Cannot post user messages to a channel they are not in." This is the sibling of channel_not_found, and telling them apart matters: channel_not_found is an identifier/visibility problem, not_in_channel is purely a membership problem. A bot that works in one channel and fails in another with this string has almost always just not been invited to the second one.

Membership in Slack is real state, not a permission bit. Bots join channels the same ways humans do: someone runs /invite @botname, or the bot joins a public channel itself via conversations.join (bot tokens with the channels:join scope — public channels only, as the method's reference notes). Private channels can only be joined by invitation from a member; no scope or API call lets a bot force its way in.

There is one deliberate bypass for posting: the chat:write.public scope lets a bot post to public channels it has not joined. Two caveats keep tripping people. First, it applies to public channels only. Second, it grants posting, not reading — conversations.history on that channel still fails without membership, so "the bot can post but can't read replies" is expected behavior under this scope, not a bug. Reading requires joining plus the relevant *:history scopes.

Operationally, this error loves channel migrations: a channel is archived and recreated, or a workflow creates fresh channels per incident/customer, and the bot that inhabited the old channel was never invited to the new one. Automating the invite step in whatever process creates channels eliminates the whole class. When the failure appears in logs, the message content is irrelevant — do not debug your blocks; check membership with conversations.members or just try conversations.join.

What it looks like

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

Why it happens

  • The bot was never invited to the target channel (or was removed from it).
  • The channel is private and the bot lacks an invitation — no scope can substitute.
  • chat:write.public is missing, so posting to un-joined public channels is not allowed.
  • A new channel replaced an old one (recreated after archiving, per-incident channels) and the invite step was skipped.
  • The operation is a read (conversations.history) under chat:write.public, which only covers posting.

How to fix Slack error not_in_channel

  1. 1Invite the bot: /invite @botname in the channel, or have any member add it via channel settings.
  2. 2For public channels, call conversations.join with the channel ID (bot token with channels:join scope) before posting.
  3. 3If the app should broadcast to public channels without joining, add chat:write.public and reinstall the app.
  4. 4For private channels, request an invitation from a member; verify afterwards with conversations.members.
  5. 5If reads are failing, join the channel and grant the matching history scope (channels:history / groups:history) — chat:write.public does not cover reading.
  6. 6Automate the invite/join step inside whatever workflow creates new channels.

How to stop it recurring

Decide per feature whether the bot joins channels or posts via chat:write.public, and encode that in onboarding: attempt conversations.join for each configured public destination and prompt for an invite on private ones. Re-verify membership when a destination starts failing — being removed from a channel produces exactly this signature. The post-works-but-read-fails asymmetry is explained 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 not_in_channel - quick answers

What does Slack error not_in_channel mean?

The channel resolved — Slack knows exactly which conversation you mean — but the identity behind your token is not a member of it, and the operation requires membership.

How do I fix Slack error not_in_channel?

1. Invite the bot: /invite @botname in the channel, or have any member add it via channel settings. 2. For public channels, call conversations.join with the channel ID (bot token with channels:join scope) before posting. 3. If the app should broadcast to public channels without joining, add chat:write.public and reinstall the app. 4. For private channels, request an invitation from a member; verify afterwards with conversations.members. 5. If reads are failing, join the…

Stop debugging Slack by hand

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