Search code examples
slackslack-api

Slack api error nongranular_bot_token_not_allowed


I've got a slack bot, which is a member of a private channel in slack. I want to use this bot to invite other users to the channel. As far as I understand, having a bot token and bot scope is enough to be able to do this (https://api.slack.com/methods/groups.invite). However, I receive a response:

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

I wasn't able to find this error in slack docs or anywhere. What does it mean?


Solution

  • The Slack support team replied that this is a new, yet undocumented error. Also, the docs are incorrect and bots aren't actually allowed to invite users to private channels:

    That's actually a new error that is going to be documented.

    Meanwhile, it seems that we, unfortunately, don't give app bot tokens permission to invite users to channels. There is an issue in the docs with how this is documented though.