← Back to Marketplace

Discord

API Key

Messages, guilds, webhooks. Build bots and integrations for communities.

https://discord.com/api/v10
OVERVIEW

The Discord API lets you build bots that interact with servers (guilds), send messages, manage channels, and respond to events. The REST API handles CRUD operations while the Gateway (WebSocket) provides real-time events.

Bot tokens use a Bot prefix in the Authorization header (not Bearer). The API is rate-limited per route, and returns rate limit headers so you can handle them gracefully. Discord uses snowflake IDs (large integers) for all resources.

GET YOUR API KEY

Authentication setup

  1. Go to discord.com/developers/applications
  2. Click New Application and give it a name
  3. Navigate to Bot in the sidebar
  4. Click Reset Token to generate a bot token
  5. Copy the token. Prefix it with Bot when creating the connection
  6. Invite the bot to your server via OAuth2 → URL Generator
Token format Bot MTIz... (prefix required)
Auth type api_key
Header Authorization
QUICK CONNECT

Create a connection in one request.

CONNECT DISCORD
POST /connections Authorization: Bearer $TOKEN Content-Type: application/json { "name": "Discord", "base_url": "https://discord.com/api/v10", "auth_type": "api_key", "auth_config": {"key": "Bot MTIz...your_bot_token", "header": "Authorization"} } → {"id": "cn_xxxxxxxx", "name": "Discord"}
KEY ENDPOINTS

What you can call via proxy.

MethodPathDescription
POST /channels/{id}/messages Send a message to a channel
GET /channels/{id}/messages Get message history
GET /guilds/{id} Get server (guild) info
GET /guilds/{id}/channels List server channels
GET /guilds/{id}/members List server members
PUT /channels/{id}/messages/{id}/reactions/{emoji}/@me Add emoji reaction
GET /users/@me Get the bot's own user info
PATCH /guilds/{id}/members/{id} Modify a guild member (roles, nick)
EXAMPLE

Send Message

PROXY CALL
POST /proxy/cn_xxxxxxxx/channels/123456789/messages Authorization: Bearer $TOKEN Content-Type: application/json { "content": "Build deployed successfully!", "embeds": [{ "title": "Deploy #142", "description": "Production updated to v2.4.1", "color": 5763719 }] } { "id": "987654321", "channel_id": "123456789", "content": "Build deployed successfully!", "author": {"id": "111222333", "username": "DeployBot"}, "embeds": [{"title": "Deploy #142", "description": "Production updated to v2.4.1"}] }
USE CASES

What people build with Discord.

Deploy Notifications

Post rich embeds to Discord when your CI/CD pipeline completes.

Community Moderation

Auto-moderate messages, manage roles, and enforce server rules.

Webhook Integrations

Connect external services to Discord channels via webhooks.

Interactive Bots

Build slash command bots for server management, polls, and games.

# Discord > Messages, guilds, webhooks. Build bots and integrations for communities. ## Overview The Discord API lets you build bots that interact with servers (guilds), send messages, manage channels, and respond to events. The REST API handles CRUD operations while the Gateway (WebSocket) provides real-time events. Bot tokens use a <code>Bot</code> prefix in the Authorization header (not <code>Bearer</code>). The API is rate-limited per route, and returns rate limit headers so you can handle them gracefully. Discord uses snowflake IDs (large integers) for all resources. - **Base URL:** https://discord.com/api/v10 - **Auth type:** api_key - **Token format:** Bot MTIz... (prefix required) ## Get Your API Key 1. Go to discord.com/developers/applications 2. Click New Application and give it a name 3. Navigate to Bot in the sidebar 4. Click Reset Token to generate a bot token 5. Copy the token. Prefix it with Bot when creating the connection 6. Invite the bot to your server via OAuth2 → URL Generator ## Quick Connect bashcurl -X POST https://api.liteio.dev/connections \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Discord", "base_url": "https://discord.com/api/v10", "auth_type": "api_key", "auth_config": {"key": "Bot MTIz...your_bot_token", "header": "Authorization"} }' ## Key Endpoints MethodPathDescription POST/channels/{id}/messagesSend a message to a channel GET/channels/{id}/messagesGet message history GET/guilds/{id}Get server (guild) info GET/guilds/{id}/channelsList server channels GET/guilds/{id}/membersList server members PUT/channels/{id}/messages/{id}/reactions/{emoji}/@meAdd emoji reaction GET/users/@meGet the bot's own user info PATCH/guilds/{id}/members/{id}Modify a guild member (roles, nick) ## Example: Send Message bashcurl -X POST https://api.liteio.dev/proxy/cn_xxx/channels/123456789/messages \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "content": "Build deployed successfully!", "embeds": [{ "title": "Deploy #142", "description": "Production updated to v2.4.1", "color": 5763719 }] }' ## Use Cases - **Deploy Notifications**: Post rich embeds to Discord when your CI/CD pipeline completes. - **Community Moderation**: Auto-moderate messages, manage roles, and enforce server rules. - **Webhook Integrations**: Connect external services to Discord channels via webhooks. - **Interactive Bots**: Build slash command bots for server management, polls, and games. ## Links - Back to Marketplace - Developer Guide - Get API Key