API reference
Servers and channels
Look up servers, channels, members and roles, and moderate with the permissions your bot has.
Servers
| Request | Returns |
|---|---|
GET /api/servers | Servers your bot is in: [{ id, name, iconUrl, types, community, listed }] |
GET /api/servers/{serverId} | One server with its channels and roles (below) |
GET /api/servers/{serverId}/members | Everyone in it |
DELETE /api/users/@me/servers/{serverId} | Leaves the server |
{
"id": "103700000000000000",
"name": "Game Night",
"iconUrl": "https://cdn.bafflux.com/icons/....webp",
"ownerId": "103600000000000000",
"channels": [ ... ],
"roles": [ ... ],
"myRoles": ["103700000000000123"],
"invitesPaused": false,
"types": ["verified", "partnered"],
"community": true,
"listed": true
}channels only lists channels your bot can see. myRoles are your bot's roles (its own role, named after it, is one of them). roles is ordered highest first, ending with @everyone, whose ID is the server's ID.
Server types
types lists the server's types, which the Bafflux team gives out (there's no API to set them). The app shows an icon for the most important one before the server's name.
| Type | Meaning |
|---|---|
official | Run by Bafflux |
staff | Bafflux staff server |
developer | Bafflux developer server |
verified | Verified by Bafflux |
partnered | Part of the Bafflux partner program |
community is whether it's a Community server and listed whether it's in Discovery (anyone can join it). Staff and developer servers are never listed. In those, only members with Manage Server (staff) or the owner and Administrators (developer) can make invites, developer-server invites work once and last at most an hour, and only a developer server's owner can add bots.
Channels
| Field | Notes |
|---|---|
id, name, position | Position orders channels within their category |
kind | category, text, announcement, voice or thread |
parentId | The category a channel is in, or for threads, the channel the thread is under |
topic | Text and announcement channels |
slowmodeSecs | Seconds between messages per person (0 = off). Manage Messages and Manage Channels skip it |
contentMode | default, spoiler (covered until clicked) or age_restricted (18+) |
autoArchiveMinutes | Threads: hide after this long without messages. Channels: the default for new threads |
archived | Threads: hidden from the channel list until someone posts |
threadOwnerId, threadStarterId, messageCount | Threads only |
With Manage Channels:
| Request | Body |
|---|---|
POST /api/servers/{serverId}/channels | { "name": "clips", "kind": "text", "parentId": "<categoryId or null>" } |
PATCH /api/channels/{channelId} | Any of name, topic, slowmodeSecs, contentMode, parentId, kind (text / announcement), autoArchiveMinutes, archived |
DELETE /api/channels/{channelId} | Deletes it with its messages and threads |
Members
{
"user": { "id": "103600000000000000", "username": "andre", "displayName": "Andre", "avatarUrl": null },
"status": "online",
"customStatus": "making a bot",
"isOwner": true,
"roles": ["103700000000000456"]
}status is online, idle, dnd or offline.
Roles
| Field | Notes |
|---|---|
id, name, color | color is #rrggbb or null |
hoist | Shown as its own group in the member list |
position | Higher = more power. @everyone is 0 |
permissions | A number made of permission bits |
With Manage Roles, a bot can give and take roles below its own highest role:
PUT /api/servers/{serverId}/members/{userId}/roles/{roleId}
DELETE /api/servers/{serverId}/members/{userId}/roles/{roleId}A bot's own role can't be deleted or given to anyone else; it goes away when the bot leaves.
Moderation
| Request | Needs | Notes |
|---|---|---|
DELETE /api/servers/{serverId}/members/{userId} | Kick Members | They can rejoin with an invite |
PUT /api/servers/{serverId}/bans/{userId} | Ban Members | Body { "reason": "..." } (optional, up to 512 characters) |
DELETE /api/servers/{serverId}/bans/{userId} | Ban Members | Lifts the ban |
GET /api/servers/{serverId}/bans | Ban Members | Lists bans |
You can only kick or ban people whose highest role is below your bot's, never the owner. They get a notice from Bafflux saying they were removed.