Discord Bot API for sending messages, reading channels, managing servers, and interacting with users. Uses bot tokens (not user OAuth). Add your bot to a server, then use endpoints like channels//messages to send messages, guilds//channels to list channels, and guilds//members to list members. All endpoints use the v10 REST API.
9 example endpoints available through Lava’s AI Gateway. See the Discord API docs for full documentation.
This provider requires your own credentials — connect your API key or OAuth account before use.
Endpoints
Send a message to a channel
POST https://discord.com/api/v10/channels/123456789/messages — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/channels/123456789/messages' , { body: { "content" : "Hello from Lava!" } });
curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fchannels%2F123456789%2Fmessages" \
-H "Authorization: Bearer $LAVA_SECRET_KEY " \
-H "Content-Type: application/json" \
-d '{"content":"Hello from Lava!"}'
Get messages from a channel. Use query params: limit (1-100, default 50), before, after, around.
GET https://discord.com/api/v10/channels/123456789/messages?limit=10 — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/channels/123456789/messages?limit=10' , { method: 'GET' });
curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fchannels%2F123456789%2Fmessages%3Flimit%3D10" \
-H "Authorization: Bearer $LAVA_SECRET_KEY "
List all channels in a server (guild)
GET https://discord.com/api/v10/guilds/123456789/channels — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/guilds/123456789/channels' , { method: 'GET' });
curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fguilds%2F123456789%2Fchannels" \
-H "Authorization: Bearer $LAVA_SECRET_KEY "
GET https://discord.com/api/v10/guilds/123456789/members?limit=100 — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/guilds/123456789/members?limit=100' , { method: 'GET' });
curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fguilds%2F123456789%2Fmembers%3Flimit%3D100" \
-H "Authorization: Bearer $LAVA_SECRET_KEY "
Get the bot user object
GET https://discord.com/api/v10/users/@me — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/users/@me' , { method: 'GET' });
curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fusers%2F%40me" \
-H "Authorization: Bearer $LAVA_SECRET_KEY "
List servers (guilds) the bot is in
GET https://discord.com/api/v10/users/@me/guilds — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/users/@me/guilds' , { method: 'GET' });
curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fusers%2F%40me%2Fguilds" \
-H "Authorization: Bearer $LAVA_SECRET_KEY "
Edit a message
PATCH https://discord.com/api/v10/channels/123456789/messages/987654321 — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/channels/123456789/messages/987654321' , { method: 'PATCH' , body: { "content" : "Edited message" } });
curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fchannels%2F123456789%2Fmessages%2F987654321" \
-H "Authorization: Bearer $LAVA_SECRET_KEY " \
-H "Content-Type: application/json" \
-d '{"content":"Edited message"}'
Delete a message
DELETE https://discord.com/api/v10/channels/123456789/messages/987654321 — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/channels/123456789/messages/987654321' , { method: 'DELETE' });
curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fchannels%2F123456789%2Fmessages%2F987654321" \
-H "Authorization: Bearer $LAVA_SECRET_KEY " \
-H "Content-Type: application/json"
Add a reaction to a message. URL-encode the emoji.
PUT https://discord.com/api/v10/channels/123456789/messages/987654321/reactions/%F0%9F%91%8D/@me — Free
const data = await lava . gateway ( 'https://discord.com/api/v10/channels/123456789/messages/987654321/reactions/%F0%9F%91%8D/@me' , { method: 'PUT' });
curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fchannels%2F123456789%2Fmessages%2F987654321%2Freactions%2F%25F0%259F%2591%258D%2F%40me" \
-H "Authorization: Bearer $LAVA_SECRET_KEY " \
-H "Content-Type: application/json"
Next Steps
All Providers Browse all supported AI providers
Forward Proxy Learn how to construct proxy URLs and authenticate requests