Bafflux Docs Developer Portal

API reference

Servers and channels

Look up servers, channels, members and roles, and moderate with the permissions your bot has.

Servers

RequestReturns
GET /api/serversServers 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}/membersEveryone in it
DELETE /api/users/@me/servers/{serverId}Leaves the server
json
{
	"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.

TypeMeaning
officialRun by Bafflux
staffBafflux staff server
developerBafflux developer server
verifiedVerified by Bafflux
partneredPart 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

FieldNotes
id, name, positionPosition orders channels within their category
kindcategory, text, announcement, voice or thread
parentIdThe category a channel is in, or for threads, the channel the thread is under
topicText and announcement channels
slowmodeSecsSeconds between messages per person (0 = off). Manage Messages and Manage Channels skip it
contentModedefault, spoiler (covered until clicked) or age_restricted (18+)
autoArchiveMinutesThreads: hide after this long without messages. Channels: the default for new threads
archivedThreads: hidden from the channel list until someone posts
threadOwnerId, threadStarterId, messageCountThreads only

With Manage Channels:

RequestBody
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

json
{
	"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

FieldNotes
id, name, colorcolor is #rrggbb or null
hoistShown as its own group in the member list
positionHigher = more power. @everyone is 0
permissionsA number made of permission bits

With Manage Roles, a bot can give and take roles below its own highest role:

http
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

RequestNeedsNotes
DELETE /api/servers/{serverId}/members/{userId}Kick MembersThey can rejoin with an invite
PUT /api/servers/{serverId}/bans/{userId}Ban MembersBody { "reason": "..." } (optional, up to 512 characters)
DELETE /api/servers/{serverId}/bans/{userId}Ban MembersLifts the ban
GET /api/servers/{serverId}/bansBan MembersLists 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.