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.baff.gg/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 baff.gg 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 baff.gg |
staff | baff.gg staff server |
developer | baff.gg developer server |
verified | Verified by baff.gg |
partnered | Part of the baff.gg 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, forum, voice or thread |
parentId | The category a channel is in, or for threads, the channel the thread is under (for forum posts, the forum) |
topic | Text and announcement channels. Forums: the post guidelines |
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 |
threadLocked | Threads and forum posts: only Manage Threads can post |
availableTags | Forums: [{ "id", "name", "emoji" }], up to 20. emoji is a Unicode emoji, a custom one as name:id, or null |
requireTag, defaultSortOrder | Forums: posts need a tag; the post list's order (activity or created) |
appliedTags | Forum posts: tag ids from the forum |
A forum channel lists posts instead of messages; see Forum posts.
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. Forums also take availableTags (the whole list; keep a tag's id to keep it on posts), requireTag and defaultSortOrder |
DELETE /api/channels/{channelId} | Deletes it with its messages and threads |
Threads and forum posts can also be edited by whoever started them (name, autoArchiveMinutes, archived, and a post's appliedTags) and by anyone with Manage Threads there, who can also set locked, slowmodeSecs and delete them.
Members
{
"user": { "id": "103600000000000000", "username": "andre", "displayName": "Andre", "avatarUrl": null },
"status": "online",
"customStatus": "making a bot",
"isOwner": true,
"roles": ["103700000000000456"],
"nick": null,
"joinedAt": "2026-10-02T18:04:11Z",
"pending": false
}status is online, idle, dnd or offline. joinedAt is when they joined the server (for a bot, when it was added).
pending is true for someone who joined a server with Rules Screening on and hasn't agreed to its rules yet. Until they do, they can read but not send messages, react, use commands, join voice or DM members through the server (those answer 403 screening_pending). Bots are never pending. GET /api/servers/{serverId}/screening returns the server's { enabled, description, rules }.
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 |
badge | Almost always null. In official baff.gg servers, the profile badge the role gives (set by baff.gg staff; read-only) |
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 baff.gg saying they were removed. Kicks also take an optional body { "reason": "..." } for the audit log.
Timeouts
A timed-out member can still read, but can't send messages, react (not even by joining a reaction), start threads, join voice or create invites until it ends: every permission except View Channel is gone, and those routes answer 403 timed_out. Leaving and coming back doesn't end it.
| Request | Needs | Notes |
|---|---|---|
PUT /api/servers/{serverId}/members/{userId}/timeout | Moderate Members | Body { "durationSecs": 600, "reason": "..." }: 60 seconds to 28 days, reason optional (up to 512 characters). Answers { "timeoutUntil": "..." }. A new timeout replaces the old one |
DELETE /api/servers/{serverId}/members/{userId}/timeout | Moderate Members | Ends it early (404 not_timed_out if there's none) |
Same hierarchy as kicks, and never an Administrator (cant_timeout_admin). The member list shows timeoutUntil on timed-out members, and MEMBER_UPDATE carries timeoutUntil (null when it ends or is removed).
Audit log
Every change worth knowing about, kept for 90 days, newest first. Needs View Audit Log or Manage Server.
GET /api/servers/{serverId}/audit-log?before={entryId}&limit=50&userId={who}&action={action}All query parameters are optional: before pages back (pass the last entry's id), limit is 1 to 100 (default 50), userId keeps entries by one person, action keeps one kind.
{
"entries": [
{
"id": "104546711128506368",
"action": "member_timeout",
"actorId": "103600000000000000",
"targetType": "user",
"targetId": "103600000000000777",
"targetName": "sam",
"reason": "Spamming",
"changes": [{ "key": "timeoutUntil", "old": null, "new": "2026-10-16T09:00:00Z" }],
"extra": {},
"createdAt": "2026-10-16T08:50:00Z"
}
],
"users": [{ "id": "103600000000000000", "username": "andre", "displayName": "Andre", "avatarUrl": null }],
"hasMore": true
}actorId is null for AutoMod. targetType is server, channel, role, user, invite, webhook, emoji or automod_rule; targetName is the name when it happened. changes lists { key, old, new }; permissions are decimal strings. users has everyone the page names.
action | When |
|---|---|
server_update, server_owner_transfer | Name or icon changed; ownership moved |
channel_create, channel_update, channel_delete, channel_overwrite_update | Channels and categories, and their permission overrides |
role_create, role_update, role_delete | Roles |
member_kick, member_ban_add, member_ban_remove | Kicks and bans (with the reason) |
member_timeout, member_timeout_remove | Timeouts |
member_role_update, member_nick_update | Roles given or taken ($add / $remove), nicknames |
message_delete | Someone deleted another person's message (extra.channelId) |
invite_create, invite_delete | Invites (targetName is the code) |
webhook_create, webhook_update, webhook_delete | Webhooks |
emoji_create, emoji_update, emoji_delete | Custom emoji |
bot_add | An app was added (extra.permissions) |
automod_rule_create, automod_rule_update, automod_rule_delete | AutoMod rules |
automod_block, automod_alert | AutoMod stopped or flagged a message (extra.channelId, extra.ruleName) |
AutoMod
Servers can have AutoMod rules (Server Settings > AutoMod). They only check messages people send or edit: your bot's messages and webhooks are never stopped. When a rule blocks a person's message, the send or edit answers 400 automod_blocked.