Create an AutoMod rule in a Discord server via the API

domain: docs.discord.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Ensure your bot has the MANAGE_GUILD permission in the target server
  2. POST to https://discord.com/api/v10/guilds/{guild.id}/auto-moderation/rules with a JSON body specifying name, event_type (1 for message send), trigger_type, trigger_metadata, and actions array
  3. For keyword-based rules set trigger_type to 1 and populate trigger_metadata.keyword_filter (max 100 keywords, each up to 60 characters) and optionally allow_list for exemptions
  4. Define at least one action in the actions array; action types include block message (1), send alert message (2), and timeout (3)
  5. Optionally set exempt_roles and exempt_channels arrays so moderators and bot channels are not subject to the rule

Known gotchas

Related routes

Create and bind a TikTok Ads Automated Rule via the Optimizer Rule API
business-api.tiktok.com · 5 steps · unrated
Create Discord threads via the API (from a message or standalone) and manage thread membership
discord.com · 7 steps · unrated
Create a Discord bot application, obtain the bot token, invite the bot to a server, and send a text message to a channel via the REST API
discord.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans