API reference
Pictures
Avatars, icons, banners, emoji and stickers, as the CDN would serve them.
User Avatar
/avatars/{user.id}/{avatar.hash}No sign-in neededA person's or bot's picture. The avatar field of a user is the hash.
Set your library's CDN base to <origin>/api/v1 (discord.py discord.asset.Asset.BASE, discord.js rest: { cdn }) and the .png?size= addresses it builds work. The extension and ?size= do not convert anything: every picture is stored once and served as it is, with the content type read from its bytes. A hash that starts with a_ is animated (free for everyone, as on Discord with Nitro): the plain address, .png, .jpg and .webp give a still of the first frame; .gif gives the GIF; .webp?animated=true gives the animated WebP. A hash that is not there is 404; an extension other than .png, .jpg, .jpeg, .webp or .gif is 400.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
user.id- A snowflake id.
avatar.hash- The
avatarhash (a_and 32 hex characters when animated), with or without an extension (.png).
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
GENERAL0 · HTTP 404- No such picture (
404: Not Found).
Discord
Like Discord’s User Avatar, with differences.
Served by the API, not a CDN.
Default User Avatar
/embed/avatars/{index}.pngNo sign-in neededDiscord's default avatars 0 to 5, for people with no picture of their own.
A placeholder: a flat 128-pixel colour square made on the spot (one of Discord's six colours, picked as Discord does), not Discord's artwork. The web app draws its own default picture.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
index- 0 to 5.
Response
200 no body
A PNG.
Errors
GENERAL0 · HTTP 404- The index is not 0 to 5.
Discord
Like Discord’s Default User Avatar, with differences.
A flat colour, not Discord's artwork.
User Banner
/banners/{user.id}/{banner.hash}No sign-in neededA profile banner. The banner field of a user is the hash.
The same as the avatar: A hash that starts with a_ is animated (free for everyone, as on Discord with Nitro): the plain address, .png, .jpg and .webp give a still of the first frame; .gif gives the GIF; .webp?animated=true gives the animated WebP.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
user.id- A snowflake id.
banner.hash- The
bannerhash (a_and 32 hex characters when animated).
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
GENERAL0 · HTTP 404- No such picture.
Discord
Like Discord’s User Banner, with differences.
Served by the API.
Guild Icon
/icons/{guild.id}/{icon.hash}No sign-in neededA server's icon. The icon field of a guild is the hash.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
guild.id- A snowflake id.
icon.hash- The
iconhash.
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
GENERAL0 · HTTP 404- No such picture.
Discord
Like Discord’s Guild Icon, with differences.
Served by the API.
Guild Banner
/guild-banners/{guild.id}/{banner.hash}No sign-in neededA server's banner (16:9, up to 1920×1080). The banner field of a guild is the hash.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
guild.id- A snowflake id.
banner.hash- The
bannerhash.
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
GENERAL0 · HTTP 404- No such picture.
Discord
Like Discord’s Guild Banner, with differences.
Served by the API; Discord uses /banners/{guild.id}/….
Custom Emoji
/emojis/{emoji.id}.{ext}No sign-in neededA custom emoji's picture, <id>.webp or <id>.gif (animated). .png, .jpg and .jpeg give the still picture.
Public and immutable (cached for a year): anyone who has seen the emoji in a message has it.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
emoji.id- The emoji's id.
extwebp,gif,png,jpgorjpeg..gifonly for an animated emoji.
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
UNKNOWN_EMOJI10014 · HTTP 404- No such emoji picture.
Discord
Like Discord’s Custom Emoji, with differences.
Served by the API.
Guild Scheduled Event Cover
/guild-events/{event.id}/{image.hash}No sign-in neededAn event's cover picture (16:9). The image field of an event is the hash.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
event.id- The event's id.
image.hash- The
imagehash.
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
GENERAL0 · HTTP 404- No such picture.
Discord
Like Discord’s Guild Scheduled Event Cover, with differences.
Served by the API.
Guild Scheduled Event Icon
/guild-events/{event.id}/icons/{icon.hash}No sign-in neededtether onlyAn event's icon (a small square picture, at most 128×128). The icon field of an event is the hash. Tether's own addition.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
event.id- The event's id.
icon.hash- The
iconhash.
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
GENERAL0 · HTTP 404- No such picture.
Discord
Only on tether: Discord has no such route.
Served by the API; Discord events have no icon.
Sticker
/stickers/{sticker.id}.{ext}No sign-in neededA sticker's picture, <id>.png (a PNG, or an animated PNG) or <id>.gif (a GIF sticker). .webp, .jpg and .jpeg give the PNG.
Public and immutable (cached for a year): anyone who has seen the sticker in a message has it. The sticker's format_type says which it is.
Who can call it
- No sign-in is needed (public).
- A person, with a session token.
- A bot, with its token.
Path parameters
sticker.id- The sticker's id.
extpng,gif,webp,jpgorjpeg..gifonly for a GIF sticker.
Response
200 no body
The picture's bytes (usually WebP), cached for a year.
Errors
UNKNOWN_STICKER10060 · HTTP 404- No such sticker picture.
Discord
Like Discord’s Sticker, with differences.
Served by the API.