Menu
Does Discord have an API? A map of the Discord API and its docs
Discord has a public API for bots and apps. This is a map of it: what each part does, the base URL and versions, how to authenticate, and where the official docs moved to in 2026.
Step 0Before you start: create a free VaultCord account
Do this before you write any code. A free VaultCord account gives you a working verification flow to compare your own against, plus a fallback if your bot goes down.
- Your own branded bot: 1 on Free, 3 on Premium, unlimited on Plus, online 24/7.
- Unlimited restorable members on every plan, Free included. Pulls run at one member every 0.98 seconds, on every plan.
- Developer API to pull members with code (Plus), plus a Resell Members API. Plus is $9.97/mo, or $3.83/mo billed yearly.
- An MCP server, so Claude or another MCP client can run your account, and the iOS and Android apps.
On this page
Yes, and it has several parts
Everything a bot does goes through Discord's developer platform. You register an application in the Developer Portal and get credentials for it. The parts you will meet:
| Part | Transport | Used for |
|---|---|---|
| REST API | HTTPS | Reading and changing things: messages, channels, roles, members, commands |
| Gateway | WebSocket | Receiving events in real time: new messages, members joining, presence |
| OAuth2 | HTTPS redirects | Login with Discord, adding bots, acting for a user (guilds.join, other scopes) |
| Interactions | Gateway or your own HTTP endpoint | Slash commands, buttons, select menus, modals |
| Webhooks | HTTPS | Posting into a channel without a bot, and receiving app events from Discord |
| Embedded App SDK and Social SDK | Client SDKs | Activities inside Discord, and Discord features inside games |
Base URL, versions and auth
The REST base URL is https://discord.com/api. Put the version in the path, because leaving it out routes you to whatever the default is, and that can change under you.
| Version | Status |
|---|---|
10 | Available. Use this one |
9 | Available |
8, 7, 6 | Deprecated |
5, 4, 3 | Discontinued, requests fail with 400 Bad Request |
- Bot token:
Authorization: Bot <token>, from the Bot page of your application. - User token from OAuth2:
Authorization: Bearer <access_token>. - User-Agent:
DiscordBot ($url, $versionNumber). Requests without a valid one may be blocked. - TLS: all HTTP and WebSocket traffic uses TLS 1.2.
- IDs: snowflakes up to 64 bits, always returned as strings. Don't parse them into JavaScript numbers.
- Dates: ISO8601. Images come from
https://cdn.discordapp.com/.
Your first request
Fetching your own bot user is the quickest way to check that the token, headers and version are right:
curl https://discord.com/api/v10/users/@me \
-H "Authorization: Bot $BOT_TOKEN" \
-H "User-Agent: DiscordBot (https://example.com, 1.0)"const res = await fetch("https://discord.com/api/v10/users/@me", {
headers: {
Authorization: `Bot ${process.env.BOT_TOKEN}`,
"User-Agent": "DiscordBot (https://example.com, 1.0)",
},
})
const me = await res.json()
console.log(me.id, me.username) // IDs are stringsimport os
import requests
r = requests.get(
"https://discord.com/api/v10/users/@me",
headers={
"Authorization": f"Bot {os.environ['BOT_TOKEN']}",
"User-Agent": "DiscordBot (https://example.com, 1.0)",
},
)
me = r.json()
print(me["id"], me["username"]) # IDs are stringsA 401 means the token or header format is wrong. Once that works, read the rate limit guide before you write anything that loops.
The Gateway
The REST API only answers when you ask. To react to things as they happen, a bot opens a WebSocket to the Gateway. Get the URL from GET /gateway/bot (needs a bot token; it also returns session start limits) or GET /gateway (no auth). After the Hello event, the bot sends a heartbeat every heartbeat_interval milliseconds to stay connected.
- Encoding is
jsonoretf. Pick JSON if you are unsure. - You can send 120 events per connection every 60 seconds. Going over disconnects you.
- A bot gets 1000 IDENTIFY calls per 24 hours, so a crash loop that reconnects forever will run out.
Intents
Intents are a bitfield you send when identifying, telling Discord which events you want. They are required from v8 on. Three are privileged and must be switched on in the Developer Portal first: GUILD_MEMBERS, GUILD_PRESENCES and MESSAGE_CONTENT.
Sharding
One Gateway connection (a shard) handles at most 2500 servers. Once a bot is in 2500 or more, sharding is required.
Where the documentation lives
The official reference is at docs.discord.com/developers. Discord moved its developer docs to a new platform in February 2026 and reorganized them on March 9, 2026, with new tabs and sidebars per feature area. Old discord.com/developers/docs URLs now redirect to the new site, so existing links keep working.
The pages you will open most:
- Reference: base URL, versioning, authentication, snowflakes.
- Rate Limits and Opcodes and Status Codes: what your errors mean.
- OAuth2: flows, scopes and token URLs.
- Gateway and Gateway Events: connecting and the events you receive.
- Change Log: read it monthly. API changes are announced here with dates.
The Markdown source is public in the discord/discord-api-docs repository on GitHub, which is also where people file documentation issues.
What changed in 2026
A few recent changes from Discord's change log that affect bots:
| Date | Change |
|---|---|
| Sep 15, 2026 | Bots with large sharding must pass a shard parameter to Get Current User Guilds, or get a 400. |
| Sep 22, 2026 | Age assurance: apps may see changes in presence, Activities, purchases and DM filtering for affected users. |
| Oct 14, 2026 | OAuth2 redirects include an iss parameter set to https://discord.com. |
| Oct 30, 2026 | New endpoints that return a member's or role's permissions for a guild or channel. |
| Nov 16, 2026 | Bots without VIEW_CHANNEL get obfuscated channels over the Gateway, and the HTTP channel list leaves those channels out. |
Check status before you debug
If everything fails at once, look at discordstatus.com before you rewrite your code.
VaultCord's API
VaultCord sits on top of the Discord API for one job: backing up servers and getting verified members back after a raid or deletion. Developer API to pull members with code (Plus), plus a Resell Members API. Under the hood it uses the same guilds.join flow described on this site, at one member every 0.98 seconds, on every plan.
Its own reference is at docs.vaultcord.com, and keys are created in the dashboard.
FAQ
Does Discord have an API?
Yes. Discord has a public developer platform: a REST API over HTTPS, a WebSocket Gateway for real-time events, OAuth2 for acting on behalf of users, and SDKs for Activities and games. Bots use all of it with a bot token from the Developer Portal.
Where is the Discord API documentation?
At docs.discord.com/developers. The old discord.com/developers/docs links redirect there. The source of the docs is also public in the discord/discord-api-docs repository on GitHub.
What version of the Discord API should I use?
Version 10. Versions 10 and 9 are available, 8, 7 and 6 are deprecated, and 5, 4 and 3 are discontinued and fail with 400 Bad Request. Put the version in the path, for example https://discord.com/api/v10.
Is there a Discord API key?
Not in the usual sense. Bots authenticate with a bot token sent as Authorization: Bot <token>. Apps acting for a user send an OAuth2 access token as Authorization: Bearer <token>.
How do I check if the Discord API is down?
Discord posts incidents and API status at discordstatus.com. If it is green and your requests fail, check your own rate limit headers and error codes first.
Last updated on November 19, 2026