# Discord API **Provider:** Discord **Category:** social **Base URL:** `https://discord.com/api/v10` **Auth:** bearer โ€” `Authorization: Bot MTk4NjIyNDgzNDcxOTI1MjQ4.GlLjkw.abc` **Rate Limit:** 50 requests/sec global ยท Per-route limits vary (most routes: 5 req/5 sec) **Free Tier:** Yes โ€” [object Object] **Pricing:** Free tier available (freemium) **Docs:** https://discord.com/developers/docs ## Description The Discord API powers bots, integrations, and OAuth apps on the Discord platform. Create and manage channels, send messages and embeds, assign roles, listen to events via WebSocket Gateway, implement slash commands and context menus, manage server members, and integrate with Discord's voice channels. Used for community bots, game integrations, developer tools, and notification systems. Supports both bot tokens and OAuth2 for user-scoped actions. ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `https://discord.com/api/v10/channels/{channel_id}/messages` | Send a message to a channel | | GET | `https://discord.com/api/v10/guilds/{guild_id}` | Get server (guild) info and settings | | GET | `https://discord.com/api/v10/guilds/{guild_id}/members` | List members in a server | | PUT | `https://discord.com/api/v10/guilds/{guild_id}/members/{user_id}/roles/{role_id}` | Add a role to a member | | POST | `https://discord.com/api/v10/applications/{app_id}/commands` | Register a global slash command | | GET | `https://discord.com/api/v10/users/@me` | Get the current bot or OAuth user info | ## Authentication Bot token: prefix with "Bot " (e.g., "Bot MTk4NjIyNDgzNDcxOTI1MjQ4.GlLjkw.abc"). OAuth2 Bearer token for user-scoped actions. Create an application at discord.com/developers. ``` Authorization: Bot MTk4NjIyNDgzNDcxOTI1MjQ4.GlLjkw.abc ``` ## Sample Request ```bash curl "https://discord.com/api/v10/channels/$CHANNEL_ID/messages" \ -H "Authorization: Bot $DISCORD_BOT_TOKEN" \ -H "Content-Type: application/json" \ -X POST \ -d '{"content":"Hello from API Map!","embeds":[{"title":"API Directory","color":8531955,"description":"50+ APIs for developers"}]}' ``` ## Sample Response ```json { "id": "1234567890123456789", "channel_id": "987654321098765432", "content": "Hello from API Map!", "author": { "id": "111", "username": "MyBot", "bot": true }, "timestamp": "2024-03-15T10:00:00.000000+00:00", "embeds": [{ "title": "API Directory", "color": 8531955 }] } ``` ## Pricing Details The Discord API is free to use. Discord monetizes via Nitro subscriptions and server boosts. No API usage fees for developers. --- *Source: [API Map](https://apimap.dev/apis/discord/) โ€” CC BY 4.0*