Skip to content
Gamatek edited this page May 21, 2026 · 1 revision

API Reference

A Rigel API is a REST API that allows you to interact with the instance data from your own applications. It's the primary way to interact with an instance from your own code.

Base URL

https://server.rigel.chat/api

API Versioning

Caution

Some API and Gateway versions are now non-functioning, and are labeled as discontinued in the table below for posterity. Trying to use these versions will fail and return 400 Bad Request.

A Rigel instance exposes different versions of API. You should specify which version to use by including it in the request path like https://server.rigel.chat/api/v{version_number}. Omitting the version number from the route will route requests to the current default version (marked below). You can find the change log for the newest API version here.

API Versions

VersionStatusDefault
0Development

Error Messages

Authentication

Snowflake

A Rigel instance utilizes Twitter's snowflake format for uniquely identifiable descriptors (IDs). These IDs are guaranteed to be unique across all of the instance, except in some unique scenarios in which child objects share their parent's ID. Because Snowflake IDs are up to 64 bits in size (e.g. a uint64), they are always returned as strings in the HTTP API to prevent integer overflows in some languages.

Convert Snowflake to DateTime

Snowflake ID Broken Down in Binary

111111111111111111111111111111111111111111 11111 11111 111111111111
64 22 17 12 0

Snowflake ID Format Structure (Left to Right)

FieldBitsNumber of bitsDescriptionRetrieval
Timestamp63 to 2242 bitsMilliseconds since Discord Epoch, the first second of 2015 or 1420070400000.(snowflake >> 22) + 1420070400000
Internal worker ID21 to 175 bits(snowflake & 0x3E0000) >> 17
Internal process ID16 to 125 bits(snowflake & 0x1F000) >> 12
Increment11 to 012 bitsFor every ID that is generated on that process, this number is incrementedsnowflake & 0xFFF

Generating a snowflake ID from a Timestamp Example

(timestamp_ms - DISCORD_EPOCH) <<22

ID Serialization

ISO8601 Date/Time (todo: rigel just use bigint ms timestamp)

HTTP API

User Agent

Content Type

Rate Limiting

Boolean Query Strings

Array Query Strings

Gateway (WebSocket) API

Message Formatting

Rigel utilizes a subset of markdown for rendering message content on its clients, while also adding some custom functionality to enable things like mentioning users and channels. This functionality uses the following formats:

Formats

TypeStructureExample
User<@USER_ID><@80351110224678912>
Channel<#CHANNEL_ID><#103735883630395392>
Role<@&ROLE_ID><@&165511591545143296>
Standard emojiUnicode characters🪴
Custom emoji<:NAME:ID><:mmLol:216154654256398347>
Animated custom emoji<a:NAME:ID><a:b1nzy:392938283556143104>
Unix timestamp<t:TIMESTAMP><t:1618953630>
Styled unix timestamp<t:TIMESTAMP:STYLE><t:1618953630:d>

Using the markdown for users or roles will mention the target(s), and notify them depending on the sender's permissions as well as the value of the allowed_mentions field when creating a message. Standard emoji are currently rendered using Twemoji.

Timestamps are expressed in seconds and display the given timestamp in the user's timezone and locale.

Timestamp Styles

StyleExample OutputDescription
t16:20Short Time
T16:20:30Medium Time
d20/04/2021Short Date
DApril 20, 2021Long Date
f (default)April 20, 2021 at 16:20Long Date, Short Time
FTuesday, April 20, 2021 at 16:20Full Date, Short Time
s20/04/2021, 16:20Short Date, Short Time
S20/04/2021, 16:20:30Short Date, Medium Time
R4 years agoRelative Time

Image Formatting

Note

Animated images uploaded as WebP or AVIF do not convert cleanly to GIF. Apps should request animated images as WebP for maximum compatibility, as this works regardless of the original upload format.

Image Data

Signed Attachment CDN URLs

Uploading Files

Editing Message Attachments

Locales

LocaleLanguage NameNative Name
en-USEnglish, USEnglish, US