> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord

> Discord Bot API for sending messages, reading channels, managing servers, and interacting with users.

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/{id}/messages to send messages, guilds/{id}/channels to list channels, and guilds/{id}/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](https://discord.com/developers/docs/reference) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://discord.com` is supported. Discord REST API v10. Construct URL as [https://discord.com/api/v10/\&#123;resource\&#125](https://discord.com/api/v10/\&#123;resource\&#125);. See [https://discord.com/developers/docs/reference](https://discord.com/developers/docs/reference) for full reference. The endpoints below are curated examples.</Info>

## Endpoints

### Send a message to a channel

**POST** `https://discord.com/api/v10/channels/123456789/messages` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/channels/123456789/messages', { body: {"content":"Hello from Lava!"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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!"}'
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/channels/123456789/messages?limit=10', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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"
    ```
  </Tab>
</Tabs>

### List all channels in a server (guild)

**GET** `https://discord.com/api/v10/guilds/123456789/channels` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/guilds/123456789/channels', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fguilds%2F123456789%2Fchannels" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List members in a server. Use query params: limit (1-1000, default 1), after (user ID for pagination).

**GET** `https://discord.com/api/v10/guilds/123456789/members?limit=100` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/guilds/123456789/members?limit=100', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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"
    ```
  </Tab>
</Tabs>

### Get the bot user object

**GET** `https://discord.com/api/v10/users/@me` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/users/@me', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdiscord.com%2Fapi%2Fv10%2Fusers%2F%40me" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List servers (guilds) the bot is in

**GET** `https://discord.com/api/v10/users/@me/guilds` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/users/@me/guilds', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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"
    ```
  </Tab>
</Tabs>

### Edit a message

**PATCH** `https://discord.com/api/v10/channels/123456789/messages/987654321` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/channels/123456789/messages/987654321', { method: 'PATCH', body: {"content":"Edited message"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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"}'
    ```
  </Tab>
</Tabs>

### Delete a message

**DELETE** `https://discord.com/api/v10/channels/123456789/messages/987654321` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/channels/123456789/messages/987654321', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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"
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://discord.com/api/v10/channels/123456789/messages/987654321/reactions/%F0%9F%91%8D/@me', { method: 'PUT' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    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"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
