Skip to content
sanalyer API

Cosmetics

A cosmetic is an image an account wears next to its avatar, over its profile, or behind its name. The catalog lists the items on offer; the Admin API adds and changes them. An account wears at most one item of each type.

Every route on this page is user-only, requires no permission, and acts on the caller’s own account.

ValueDescription
avatar_decorationA frame drawn around the avatar
avatar_ultraA large decoration drawn behind or in front of the avatar on supported surfaces
profile_effectAn effect played over the profile card
nameplateA background behind the name in member and direct message lists
ValueDescription
freeEvery account can wear it
premiumAccounts with premium can wear it, and so can an account that owns it
ownedOnly accounts that own it can wear it
FieldTypeDescription
idsnowflakeThe ID of the item
typestringThe cosmetic item type
namestringThe display name of the item (1-64 characters)
description?stringA short description of the item (1-256 characters)
asset1stringThe hash of the item image
availabilitystringThe cosmetic availability
ultra_layout2?ultra layout objectThe sizes of an ultra decoration on each surface
ultra_front3?ultra front objectThe images of an ultra decoration drawn in front of the avatar

1 Eight hexadecimal characters, prefixed with a_ when the image is animated. The media proxy serves the image at /branding/cosmetic-{type}-{id}/{asset}.webp on the instance’s media endpoint, with size between 128 and 480 and animated=true for the moving image

2 Null for every other type, and for an ultra decoration the admin gave no sizes, which then uses the fixed sizes

3 Null for every other type, and for an ultra decoration drawn behind the avatar

{
"id": "1501314428688998182",
"type": "avatar_decoration",
"name": "Gold ring",
"description": null,
"asset": "a_1a2b3c4d",
"availability": "premium",
"ultra_layout": null,
"ultra_front": null
}

The sizes an admin gave an ultra decoration, one entry for each surface. A client that does not read it draws the fixed sizes, and so does a client whose request for it fails.

FieldTypeDescription
compact?ultra layout surface objectThe size in chat and in the member list, null for the fixed size
voice?ultra layout surface objectThe size on voice tiles, null for the fixed size
profile?ultra layout surface objectThe size on the profile card, null for the fixed size

Every value is a multiple of the avatar diameter, on the scale of the fixed sizes 2.30, 3.20 and 3.40. sanalyer keeps three decimal places.

FieldTypeDescription
widthnumberThe width of the decoration (0.5-6)
heightnumberThe height of the decoration (0.5-6)
offset_xnumberThe horizontal shift from the centre of the avatar (-3 to 3)
offset_ynumberThe vertical shift from the centre of the avatar (-3 to 3)

The images an admin gave an ultra decoration to draw it in front of the avatar. Each one is the left half of the decoration, twice as tall as it is wide, and a client draws the right half as its mirror image.

FieldTypeDescription
closedstringThe hash of the still image shown while the decoration is closed
openarray[string]The hashes of the still opening frames in order, 2 to 30 of them
idlestringThe hash of the animated loop played while the decoration is open, prefixed with a_

The media proxy serves each image like asset, under the same item path. A client asks for them with size up to 600, since an image can be 576 pixels tall.

A client that reads it draws the decoration over the avatar in a square 3.468 times the avatar diameter on every surface, and ultra_layout applies only to drawing behind. The decoration rests on closed. When the avatar is interacted with, such as on hover, on keyboard focus, or when a profile opens, the opening frames play forward at 30 frames per second and idle loops. Letting go plays the frames back from the one showing. With reduced motion or data saving on, the decoration stays closed.

A client loads the frames and the loop on the first open and replays every later open from what it loaded. It draws no ultra decoration before it has read the item through List cosmetic items by ID, so a decoration never jumps from behind the avatar to the front. A client that does not read it, or whose request for the item fails, draws asset behind the avatar.

The item an account wears, as it appears on the partial user and the profile. A field that carries it is always present and is null when the account wears nothing of that type.

FieldTypeDescription
asset1stringThe hash of the image the account put on
item_idsnowflakeThe ID of the worn item

1 Copied when the item is put on, so an account keeps the image it put on after the item’s image changes. The ultra front images are not copied: a client reads them from the item, so a new set reaches every account that wears it

The partial user carries avatar_decoration_data, avatar_ultra_data and nameplate_data. The profile carries profile_effect_data.

GET/v1/cosmetics/catalog

Returns the items on offer. An item taken off sale is not listed.

FieldTypeDescription
type?stringOnly return items of this cosmetic item type
StatusBodyCondition
200array[cosmetic item object]Catalog was returned

Each API process keeps the catalog for up to 60 seconds, so a catalog change can take that long to appear.

30 requests per minute for each authenticated user, on the cosmetics:catalog bucket.

GET/v1/cosmetics/items

Returns up to 50 items by ID, including items taken off sale, as an array of cosmetic item objects. A client uses it to draw what other accounts wear, such as the sizes and in-front images of an ultra decoration, with one request for every batch of new items it sees. An unknown ID is left out, and a repeated ID is returned once.

FieldTypeDescription
idsstringComma separated item IDs, 1 to 50 of them
StatusBodyCondition
200array[cosmetic item object]The known items were returned
400error responseMore than 50 IDs, or an ID that is not a positive 64-bit integer, returned as INVALID_FORM_BODY

Each API process keeps an item for up to 60 seconds, and at most 5,000 items, so a change an admin makes can take that long to appear.

30 requests per minute for each authenticated user, on the cosmetics:items bucket.

GET/v1/users/@me/cosmetics

Returns the items the current account owns and the items it wears.

FieldTypeDescription
ownedarray[cosmetic item object]The items the account owns, including items taken off sale
equippedequipped cosmetics objectThe items the account wears
StatusBodyCondition
200response bodyItems were returned

30 requests per minute for each authenticated user, on the cosmetics:list_own bucket.

FieldTypeDescription
avatar_decoration_id?snowflakeThe avatar decoration being worn
avatar_ultra_id?snowflakeThe ultra decoration being worn
profile_effect_id?snowflakeThe profile effect being worn
nameplate_id?snowflakeThe nameplate being worn
PUT/v1/users/@me/cosmetics/equipped

Puts items on and takes them off. Returns the equipped cosmetics object.

FieldTypeDescription
avatar_decoration_id??snowflakeThe avatar decoration to wear, or null to take it off
avatar_ultra_id??snowflakeThe ultra decoration to wear, or null to take it off
profile_effect_id??snowflakeThe profile effect to wear, or null to take it off
nameplate_id??snowflakeThe nameplate to wear, or null to take it off

An omitted field leaves that type as it is.

StatusBodyCondition
200equipped cosmetics objectItems were put on or taken off
403error responseCOSMETIC_NOT_OWNED: an item is unknown, is not of the field’s type, or the account may not wear it

When a worn item changes, the account’s sessions receive User Update with the current user object. A changed avatar decoration, ultra decoration or nameplate also reaches every guild the account is in as Guild Member Update. A request that changes nothing writes nothing and emits nothing.

5 requests per 10 minutes for each authenticated user, on the cosmetics:equip bucket.