Slack API · error code

Slack error user_not_in_channel: Ephemeral recipient is not in the channel

ConfigurationHTTP 200Channels, membership & DMs

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
Intended recipient is not in the specified channel.

What error user_not_in_channel means

You called chat.postEphemeral with a user who is not a member of the channel you passed. Slack documents it as "Intended recipient is not in the specified channel." The method's usage notes explain why: an ephemeral message is shown to one user inside one conversation, and "the user must be currently active in Slack and a member of the specified channel."

Note what is being checked. With not_in_channel, the bot is missing from the channel. Here the bot may be present, but the human you are addressing is not. That happens when a slash command or button is used in one conversation and your code replies into a fixed default channel, when the user left the channel between the interaction and the reply, or when the channel and user IDs come from different events.

If you want to reach the user privately no matter where they are, an ephemeral message is the wrong tool. Open a DM with conversations.open and post there.

What it looks like

POST /api/chat.postEphemeral
{"channel": "C123ABC456", "user": "U0123ABCDEF", "text": "Only you can see this"}

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

Why it happens

  • Replying into a hard-coded channel instead of the channel_id from the interaction payload.
  • The user left or was removed from the channel before the ephemeral message was sent.
  • The user and channel IDs came from different events or workspaces.
  • Trying to notify a user in a channel they never joined.

How to fix Slack error user_not_in_channel

  1. 1Take channel and user from the same interaction or event payload.
  2. 2Check membership with conversations.members if the channel comes from configuration.
  3. 3Fall back to a DM: conversations.open with the user ID, then chat.postMessage to the returned channel ID.
  4. 4For slash commands, consider replying through the payload's response_url instead.

How to stop it recurring

Treat ephemeral messages as replies in context: always derive the channel from the triggering payload. For notifications that must reach someone wherever they are, send a DM by default and keep ephemeral posts for in-channel feedback only. Log the channel and user pair on failure to spot hard-coded destinations.

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

Related codes

Error user_not_in_channel - quick answers

What does Slack error user_not_in_channel mean?

You called chat.postEphemeral with a user who is not a member of the channel you passed. Slack documents it as "Intended recipient is not in the specified channel." The method's usage notes explain why: an ephemeral message is shown to one user inside one conversation, and "the user must be currently active in Slack and a member of the specified channel." Note what is being checked.

How do I fix Slack error user_not_in_channel?

1. Take channel and user from the same interaction or event payload. 2. Check membership with conversations.members if the channel comes from configuration. 3. Fall back to a DM: conversations.open with the user ID, then chat.postMessage to the returned channel ID. 4. For slash commands, consider replying through the payload's response_url instead.

Stop debugging Slack by hand

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