Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/toolbox-team/reddit-moderator-toolbox/llms.txt

Use this file to discover all available pages before exploring further.

Toolbox ban macros are stored in the banmacros wiki page of each subreddit. They provide pre-written ban reason templates that moderators can select during the Toolbox ban flow, saving time and ensuring consistent ban messages across a moderation team. Wiki page: banmacros | Format: Plain JSON object

Structure

The ban macros object is a flat key-value map. Each key is the display name of the macro, and each value is the template text shown in the ban reason field:
{
  "Spam": "Banned for repeated spam. See Reddit's site-wide rules on spam: https://www.redditinc.com/policies/content-policy",
  "Harassment": "Banned for harassment of other users in /r/{subreddit}.",
  "Ban Evasion": "Banned for operating a ban evasion account. Original ban issued to u/{author}.",
  "Doxxing": "Banned for sharing personal information about other users (doxxing)."
}
{macroName}
string
Each key is the human-readable name of the ban macro as it appears in the Toolbox ban dialog. Each value is the template string for the ban reason.Template placeholders supported in values:
PlaceholderReplaced with
{author}The username of the account being banned
{subreddit}The name of the subreddit
{kind}The content type that triggered the ban (post or comment)
The banmacros wiki page contains only the macro map — there is no ver field or other envelope. The entire content_md of the wiki page is the JSON object itself.

Reading ban macros

Fetch the banmacros wiki page and parse content_md directly as JSON:
const response = await fetch(
  `https://oauth.reddit.com/r/${subreddit}/wiki/banmacros.json`,
  {headers: {Authorization: `bearer ${accessToken}`}}
);
const envelope = await response.json();
const banMacros = JSON.parse(envelope.data.content_md);
// banMacros is now the key-value object of macro name → template text

Writing ban macros

Serialize the updated object and POST it to the wiki edit endpoint:
await fetch(`https://oauth.reddit.com/r/${subreddit}/api/wiki/edit`, {
  method: 'POST',
  headers: {
    Authorization: `bearer ${accessToken}`,
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({
    page: 'banmacros',
    content: JSON.stringify(banMacros),
    reason: 'updated ban macros via my-tool',
    uh: modhash,
  }),
});

Managing macros via Toolbox

Ban macros are created and edited through the Toolbox settings panel under the “Ban macros” section. Moderators with wiki edit access for the subreddit can add, rename, and delete macros from the settings UI. Changes are written back to the banmacros wiki page immediately on save.
If you are building a tool that creates or modifies ban macros programmatically, read the existing page first and merge your changes before writing. Overwriting the entire page without merging will delete macros created by other moderators.

Relationship to config banMacros

The toolbox config wiki page also has a banMacros field (see config schema). The standalone banmacros wiki page and the banMacros field in toolbox serve the same purpose; Toolbox reads from the banmacros page when it exists. Prefer the dedicated banmacros page for third-party integrations, as it avoids touching the broader config object.

Build docs developers (and LLMs) love