## TL;DR

channel_not_found almost always means the bot is not a member of the channel, not that the ID is wrong. Invite the bot to the channel and chat.postMessage succeeds. Double-check you are sending the channel ID, which starts with C, and not the channel name.

The ID is right. The bot just is not in the room.

## Verbatim query

```text
slack API error: chat.postMessage channel_not_found with a correct channel id
```

## Steps

1. Confirm you are sending the channel ID, not the name
   The ID starts with C followed by letters and numbers. A name like general is not an ID.
   Expected: The value you send matches the C-prefixed ID format.

2. Check whether the bot is a member of the channel
   List the channel members or check the bot's channel list.
   Expected: You can state plainly whether the bot is in the channel.

3. Invite the bot to the channel
   Use the Slack invite flow for the bot user, or the conversations invite method from an authorized user.
   Expected: The bot appears in the channel member list.

4. Retry chat.postMessage
   Send the same message payload again.
   Expected: An ok true response with a message timestamp.

5. Make channel membership part of the generated client's setup
   Document or automate the invite step so the next channel does not hit the same error.
   Expected: A setup checklist that includes inviting the bot.

## Use this when

- Slack chat.postMessage returns channel_not_found and the channel ID looks correct.
- A generated client posts to channels it was never invited to.
- The same bot posts fine in one channel and fails in another.

## Not for this skill when

- The error is not_a_member on a different method, which has its own handling.
- The failure is a Slack authentication or token error.
- The channel ID is genuinely wrong or from a different workspace.

## Variant phrasings

### "channel_not_found but the channel exists"

The channel exists; the bot's membership does not. Same fix.

### Bot cannot post to a channel it was just added to

Re-check membership after inviting; workspace app installs do not auto-join channels.

## Why it happens

Slack requires an app or bot to be a member of a channel before it can post there. The channel ID alone is not enough. Generated clients are usually tested in a channel the developer already added the bot to, then pointed at a fresh channel where the invite step was never done.

## Edge cases

- Private channels need an explicit invite; there is no way for the bot to join on its own.
- Archived channels reject posts even with correct membership.
- Channel ID vs channel name confusion is the other classic cause; names are not accepted.
- Installing the workspace app does not invite the bot to any channel.
- Posting in a thread on a channel the bot has not joined fails the same way.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_r6B3dbsMXS6RedPrgVTiDw
