70 %
Chris Biscardi

Discord 403 when setting role via http api

If you are already:

  • Making a request to /guilds/<guild_id>/members/<member_id>/roles/<role_id>
  • Using either an Authorization header with Bot <token> or Bearer <token>
  • Setting the user agent to something like DiscordBot (https://github.com/mybot/discord-slash-commands, 1.0)

then you probably need the role your token acts as to be higher in the role list than the role it's trying to assign to a user.

Bots can only assign roles if those roles are lower in the role list (Server Settings -> Roles -> Roles) than the bot's own role.