SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
API New Added 17 October 2026

Slack API: not_in_channel

The bot token is valid and has chat:write, but the app has not been added to the channel it is posting to. Slack treats that as membership, not permission, so adding more scopes will not help. It often shows up when a webhook-style integration moves to chat.postMessage, or when the channel ID in config points at a private channel the bot was never invited to.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Confirm the token works and see which bot it belongs to
curl -s -H "Authorization: Bearer $SLACK_BOT_TOKEN" https://slack.com/api/auth.test | jq

# Is the bot a member of the channel?
curl -s -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
  "https://slack.com/api/conversations.info?channel=C0123456789" | jq ".channel.is_member"

# Public channels: the bot can join itself (needs channels:join)
curl -s -X POST -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
  -d channel=C0123456789 https://slack.com/api/conversations.join | jq ".ok, .error"

# Private channels: invite it from Slack, typing in the channel:
# /invite @your-app-name

How to diagnose API errors

API integration errors are usually a contract mismatch: the client and the server disagree about authentication, encoding, size limits, or which version of the API is in play. Because most API clients swallow the response body and surface only the status code, the single highest-value debugging habit here is to log the full response, headers included, before you touch any code.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Reproduce the failing call with curl -v outside your application. If curl succeeds and your client fails, the bug is in your client's header or serialisation layer, not on the server.
  2. Print the exact Authorization header being sent (redact the secret, keep the prefix). A missing Bearer  prefix and a trailing newline from an environment file are the two most common causes of a mystery 401.
  3. Check for an intermediate proxy. A 413 or 502 from nginx, Cloudflare or an API gateway looks identical to one from your application, but is fixed in completely different config.
  4. For webhooks, verify the signature against the raw request body. Any middleware that parses and re-serialises JSON before your handler runs will silently break HMAC verification.
  5. Confirm the API version. Deprecation errors and unexpected schema changes almost always trace back to a pinned version header that was never updated, or one that was never pinned at all.

Tools worth reaching for

  • curl -v
  • httpie
  • Postman/Bruno
  • mitmproxy
  • ngrok (for webhooks)

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

api.slack.com api.slack.com

Related API errors

See all 20 API errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.