Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack API missing_scope for bot requests

Tags:

slack-api

I am trying to set channel topics with a bot user token, but I'm getting the missing_scope error:

{ 
  ok: false,
  error: 'missing_scope',
  needed: 'channels:write',
  provided: 'identify,bot:basic'
}

It works if I provide the "OAuth Access Token" (instead of "Bot User OAuth Access Token") from https://api.slack.com/apps/:appId/oauth, but this is a poor solution because the message that gets printed in the channel says that the app installer set the channel topic, not the bot user.

But, the docs say that bots can call channels.setTopic with a bot token, and they don't need channels:write:

pic from Slack API docs

What gives? Are there different kinds of bot tokens? Am I doing something wrong? As far as I can tell, I cannot set additional permissions for my bot user.

like image 337
tuff Avatar asked Jun 26 '26 02:06

tuff


1 Answers

It also says on the the same documentation page:

Only user tokens may use this method. Bot user tokens will not work.

And since it does indeed not work as you say I am guessing the mention of the bot token in the above table is a documentation mistake.

If you want to be 100% sure I would advise to ask the Slack team directly.

like image 63
Erik Kalkoken Avatar answered Jun 28 '26 18:06

Erik Kalkoken



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!