baff.gg 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.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.

TypeMeaning
officialRun by baff.gg
staffbaff.gg staff server
developerbaff.gg developer server
verifiedVerified by baff.gg
partneredPart 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

FieldNotes
id, name, positionPosition orders channels within their category
kindcategory, text, announcement, forum, voice or thread
parentIdThe category a channel is in, or for threads, the channel the thread is under (for forum posts, the forum)
topicText and announcement channels. Forums: the post guidelines
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
threadLockedThreads and forum posts: only Manage Threads can post
availableTagsForums: [{ "id", "name", "emoji" }], up to 20. emoji is a Unicode emoji, a custom one as name:id, or null
requireTag, defaultSortOrderForums: posts need a tag; the post list's order (activity or created)
appliedTagsForum posts: tag ids from the forum

A forum channel lists posts instead of messages; see Forum posts.

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. 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

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

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
badgeAlmost 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:

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 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.

RequestNeedsNotes
PUT /api/servers/{serverId}/members/{userId}/timeoutModerate MembersBody { "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}/timeoutModerate MembersEnds 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.

http
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.

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

actionWhen
server_update, server_owner_transferName or icon changed; ownership moved
channel_create, channel_update, channel_delete, channel_overwrite_updateChannels and categories, and their permission overrides
role_create, role_update, role_deleteRoles
member_kick, member_ban_add, member_ban_removeKicks and bans (with the reason)
member_timeout, member_timeout_removeTimeouts
member_role_update, member_nick_updateRoles given or taken ($add / $remove), nicknames
message_deleteSomeone deleted another person's message (extra.channelId)
invite_create, invite_deleteInvites (targetName is the code)
webhook_create, webhook_update, webhook_deleteWebhooks
emoji_create, emoji_update, emoji_deleteCustom emoji
bot_addAn app was added (extra.permissions)
automod_rule_create, automod_rule_update, automod_rule_deleteAutoMod rules
automod_block, automod_alertAutoMod 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.