Permissions
Permissions are a bitmask: each permission is one bit, a role's permissions is the OR of the bits it grants, and a member's permissions are the OR of their roles'. The same numbers appear in role objects, room overrides, the permissions parameter of install links, and GET /users/@me/spaces.
Add the values of the bits you need to build a mask; test a bit with (mask & bit) !== 0.
The bits#
| Bit | Value | Permission | Scope | Lets a member |
|---|---|---|---|---|
| 0 | 1 | View Room | room | See the room and read new messages |
| 1 | 2 | Send Messages | room | Post in text rooms |
| 2 | 4 | Read Message History | room | Load older messages |
| 3 | 8 | Add Reactions | room | Start a new emoji reaction on a message; joining an existing one only needs Read Message History |
| 4 | 16 | Use External Emojis | room | Use custom emoji from other spaces |
| 5 | 32 | Mention @everyone | room | Ping everyone with mention_everyone, and ping roles that are not mentionable |
| 6 | 64 | Manage Messages | room | Delete and pin other members' messages; exempt from slowmode |
| 7 | 128 | Manage Roles | space | Create, edit, reorder and delete roles below their own, and give them to or take them from anyone; edit room permission overrides (only bits they hold in that room) |
| 8 | 256 | Manage Rooms | space | Create, edit, reorder and delete rooms and sections; exempt from slowmode |
| 9 | 512 | Kick Members | space | Kick members ranked below them |
| 10 | 1024 | Ban Members | space | Ban and unban |
| 11 | 2048 | Administrator | space | Every permission in the space, overrides ignored. Only ownership transfer and deleting the space stay owner-only |
| 12 | 4096 | Manage Space | space | Edit the space's settings, icon and banner; manage invites; view the audit log; add bots |
| 13 | 8192 | Create Invite | space | Create invites; add users with spaces.join |
| 14 | 16384 | Manage Emojis | space | Upload, rename and delete custom emoji |
| 15 | 32768 | Connect | room | Join a voice room |
| 16 | 65536 | Speak | room | Use the microphone |
| 17 | 131072 | Video | room | Share camera or screen |
| 18 | 262144 | Mute Members | room | Server-mute others |
| 19 | 524288 | Deafen Members | room | Server-deafen others |
| 20 | 1048576 | Move Members | room | Move or disconnect others |
| 21 | 2097152 | Use Voice Activity | room | Talk without push-to-talk |
| 22 | 4194304 | Priority Speaker | room | Lower everyone else while speaking |
| 23 | 8388608 | Attach Files | room | Upload files and images with a message |
| 24 | 16777216 | Create Public Threads | room | Start a thread anyone in the channel can see |
| 25 | 33554432 | Create Private Threads | room | Start an invite-only thread |
| 26 | 67108864 | Send Messages In Threads | room | Talk in threads (Send Messages alone does not grant it) |
| 27 | 134217728 | Manage Threads | room | Rename, archive, lock and delete any thread; see private threads |
| 28 | 268435456 | Change Nickname | space | Set or clear their own nickname in the space (on for @everyone by default) |
| 29 | 536870912 | Manage Nicknames | space | Change or clear the nicknames of members ranked below them, and reset those members' space profiles (avatar, banner, pronouns, About Me, bio); their own nickname too |
New permissions are only ever appended; existing values never change meaning.
Useful masks#
| Mask | Value |
|---|---|
| Read and post (View Room + Send Messages + Read Message History) | 7 |
@everyone in a new space (read, post, attach files, react, external emoji, invite, start public threads and talk in threads, join and talk in voice, change their nickname) | 363044895 |
| Every room-scoped bit | 268402815 |
| Every bit | 1073741823 |
How permissions resolve#
For a member in a space:
- Owner? The space owner has every permission, always.
- Space-wide mask =
@everyone.permissions | role₁.permissions | role₂.permissions …over the member's roles. - Administrator? If bit 11 is set, the member has every permission in every room; stop here.
- Room overrides, applied in order to the space-wide mask for that room: the
@everyoneoverride, then overrides of the member's other roles (every deny first, then every allow), then the member's own user override (deny, then allow). Overrides can only touch room-scoped bits. - Threads have no overrides of their own: a thread resolves against its channel's effective overrides (and so a synced section's), with the thread bits above on top. A private thread yields no permissions at all to anyone who is neither a member nor a Manage Threads holder.
- Two implicit rules, the same as Discord's: without View Room the member has no permission at all in that room, whatever the bits say; and without Send Messages they cannot Attach Files or Mention @everyone either.
Administrator also grants every space-scoped permission for management actions (adding bots, editing the space, invites, emoji, roles, nicknames, kicks and bans), though role hierarchy still applies to Administrators - only the owner is above it.
GET /users/@me/spaces and the permissions of a space in READY give you step 2; to know what a bot may do in a room, apply that room's permission_overrides and user_overrides from READY.space_rooms (or GET /spaces/:id/rooms) yourself, or simply try the call and handle 403.
Room overrides#
A room can allow or deny room-scoped bits per role or per member, independent of the space-wide mask. Each override is {allow, deny}; a bit in deny removes the permission for that role in that room, a bit in allow grants it, and a bit in neither leaves the space-wide value. Text rooms accept the text bits (0–6 and 23); voice rooms accept View Room and the voice bits (15–22). Managing overrides needs Manage Roles, and you cannot grant through an override what you do not hold yourself.
Hierarchy#
Roles are ordered by position: @everyone is always 0, the custom roles hold unique positions from 1 up, and higher outranks lower. A member's rank is their highest role's position. The rules are Discord's, and they bind everyone but the owner - Administrators included:
- Roles: you can only create, edit, reorder or delete roles below your rank.
- Giving or taking a role depends only on the role. You can give anyone a role below your rank, or take one away - the owner, and members ranked above you, included. Roles the member holds at or above your rank are kept as they are.
- Kicking, banning and nicknames depend on the member: you can only kick or ban members whose rank is below yours, and only change the nickname of (or reset the space profile of) members whose rank is below yours. Only the owner can change the owner's; nobody can kick or ban the owner.
- You can only grant permission bits you hold yourself (Administrators hold all), on roles and in room overrides.
- You may always edit your own roles within those rules - including the owner, which is how they give themselves a colour.
- A bot's managed role is never given to anyone else, nor taken from its bot.
A bot follows the same rules: to give out a role it needs Manage Roles and a role above that role, and to kick or ban someone a role above theirs - see Bots › Giving people roles.
Positions#
- A new role goes in at position
1, just above@everyone- so whoever creates a role (a moderator, a bot) ranks above it and can manage it. Only the unbroken run of roles directly above it moves up one to make room; roles above a gap in the positions keep theirs. Read the new positions from the response and theSPACE_UPDATEthat carries them rather than working them out. - Moving one role (
PATCH /spaces/:id/roles/:roleIdwithposition) swaps it with the role holding that position, or puts it there as sent when no role holds it. - Moving several roles at once (
PATCH /spaces/:id/roles) puts each listed role in its slot; the role there, and any above it in the way, move up one, and every role not listed keeps its order around them. It is all or nothing - use it for any reorder of more than one role. - Either way, no two roles ever share a position.
- Two roles with the same position - possible only in data from an instance that predates unique positions - rank by id: the newer one is lower.
Bots and permissions#
- An install link's
permissionsvalue becomes the bot's managed role, inserted at position 1 (just above@everyone) so the person who installed it outranks it. The installer can uncheck bits on the consent page, and the server drops any bit they do not hold themselves. Administrators and the owner can grant everything. - Because the managed role starts at the bottom, a bot that gives out roles can at first only give out roles created after it. Drag its role above the roles it should hand out, under Space settings → Roles - see Bots › Giving people roles.
- The managed role can be edited afterwards like any other, moved up if the bot must give out roles or outrank people it moderates, and shows a bot badge. It cannot be deleted or given to anyone else; it disappears when the bot leaves.
- Additional roles can be assigned to the bot normally.
- Re-approving the install link re-applies the requested bits to the managed role - the way to change a bot's permissions from a link.