Discord REST API: role-based community onboarding automation

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

Steps

  1. Create a bot application in the Discord Developer Portal, invite it to the target guild with Manage Roles (and any other needed) permission, and authenticate REST calls with the bot token.
  2. Fetch existing guild roles with GET /guilds/{guild.id}/roles to get the role ids you'll assign.
  3. Assign a role to a member with PUT /guilds/{guild.id}/members/{user.id}/roles/{role.id}; this requires Manage Roles and the bot's own highest role to be positioned above the role being granted.
  4. For structured new-member flows, configure Guild Onboarding (prompts that guide new members to pick roles/channels) via the onboarding endpoints, which require Manage Guild and Manage Roles.
  5. Listen for the Guild Member Add gateway event to trigger your own automation (e.g. auto-assign a base role) the moment someone joins.

Known gotchas

Related routes

Implement Discord Linked Roles to gate a game server role behind verified in-game account status
discord.com · 6 steps · unrated
Implement Discord Linked Roles with OAuth to verify game account status for role assignment
discord.com · 6 steps · unrated
Add and remove roles on Discord guild members via the API, respecting role hierarchy
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