Slack Error: 'cant_invite_self' — Cause, Fix, and Troubleshooting Guide
Fix the Slack cant_invite_self error: you can't invite the calling user/bot via conversations.invite. Use conversations.join for public channels instead.
- #slack
- #api
- #troubleshooting
- #errors
Stuck on this Slack error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Overview
cant_invite_self is returned by conversations.invite when the user being invited is the same identity making the call — most commonly a bot trying to add itself to a channel. Self-addition uses a different method.
{
"ok": false,
"error": "cant_invite_self"
}
Symptoms
- A bot’s “join this channel” logic passes its own user id to
conversations.inviteand fails. - The same code works when inviting other users.
- Happens right where the bot tries to bootstrap into a channel.
Common Root Causes
1. Bot invites its own user id
Code fetches auth.test → user_id and then passes it to conversations.invite, effectively inviting itself.
2. Wrong method for self-join
Using conversations.invite where conversations.join is required for adding the caller to a public channel.
3. Roster loop includes the bot
A bulk invite iterates a member list that accidentally contains the bot’s own id.
How to diagnose
Confirm the invited id equals the caller:
curl -s https://slack.com/api/auth.test \
-H "Authorization: Bearer $SLACK_BOT_TOKEN"
{"ok": true, "user_id": "U0BOTBOT01"}
curl -s -X POST https://slack.com/api/conversations.invite \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"C0123456789","users":"U0BOTBOT01"}'
{"ok": false, "error": "cant_invite_self"}
Fixes
- Use
conversations.jointo add the bot itself to a public channel (needs thechannels:joinscope):
curl -s -X POST https://slack.com/api/conversations.join \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"C0123456789"}'
- For private channels, the bot can’t self-join — a human member (or admin) must invite it.
- Exclude the bot’s own id from any roster you feed to
conversations.invite.
What to watch out for
conversations.joinonly works for public channels and needschannels:join; private channels require a human to invite the bot.- Distinguish
cant_invite_self(inviting the caller) fromalready_in_channel(target already a member) andnot_in_channel(bot lacks membership to act). - After joining, verify with
conversations.membersbefore posting, so you don’t chase anot_in_channelnext.
Related
- Slack Error: ‘not_in_channel’
- Slack Error: ‘channel_not_found’
- Slack admin conversations API: bulk channel ops
Fixed it? Get 500 Slack & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.