Gateway
This endpoint returns the bot Gateway URL, recommended shard count and advertised session start limits. See the Gateway overview for the WebSocket protocol.
Use a bot token. User clients read endpoints.gateway from instance discovery and send their session token in Identify.
Gateway information object
Section titled “Gateway information object”Every field is always present.
Structure
Section titled “Structure”| Field | Type | Description |
|---|---|---|
| url | string | The ws or wss URL, identical to endpoints.gateway in instance discovery |
| shards | integer | Recommended shard count, always 1 |
| session_start_limit | session start limit object | Fixed session start values |
FiveCord appends no query string, so a client appends the connection parameters itself. A client MUST NOT rewrite a published ws value to wss, because a deployment that deliberately serves plain HTTP advertises a ws value.
Example
Section titled “Example”{ "url": "wss://gateway.example.com", "shards": 1, "session_start_limit": { "total": 1000, "remaining": 999, "reset_after": 14400000, "max_concurrency": 1 }}Identify accepts a shard pair whose shard_count element is from 1 through 16,384 under the sharding contract, whatever shards reports. A bot session whose shard is assigned more than 2,500 guilds closes with 4011, and the bot must shard further. A user session is never checked against the guild ceiling.
Session start limit object
Section titled “Session start limit object”These are fixed compatibility values, not live usage counters.
Structure
Section titled “Structure”| Field | Type | Description |
|---|---|---|
| total | integer | Reported session starts allowed, always 1000 |
| remaining | integer | Reported session starts remaining, always 999 |
| reset_after | integer | Reported reset interval in milliseconds, always 14400000 (four hours) |
| max_concurrency1 | integer | Reported concurrent Identify buckets, always 1 |
1 A bot does not need to pace Identify requests against this value
The limits the Gateway enforces are in Session lifecycle. FiveCord rate limits Identify per source address and limits a user account to a fixed number of concurrent sessions. Neither bound is reported here.
Get Gateway information
Section titled “Get Gateway information”GET/v1/gateway/botReturns a Gateway information object.
Accepted forms are Bot <token>, Bearer <token> and <token>. Prefixes ignore case and surrounding token whitespace is trimmed. The token must contain a full stop with decimal digits before it and at least one character after it, and must not start with flx_.
Validate a token with Identify or Get bot application instead.
A 200 has the informational rate limit headers only for the Bot prefix. For the bare form and the Bearer form, FiveCord keys the rate limit bucket on the client IP address.
Response
Section titled “Response”| Status | Body | Condition |
|---|---|---|
| 200 | Gateway information object | The credential is in bot token form |
| 4011 | error response | The credential is absent, is empty after its scheme prefix, or is not in bot token form |
1 An absent or empty credential uses MISSING_AUTHORIZATION, and every other rejected value uses INVALID_AUTH_TOKEN
Side effects
Section titled “Side effects”Use the Bot authorisation prefix. Repeated invalid authentication can trigger the abuse protections.
Rate limit
Section titled “Rate limit”60 requests per minute for each authenticated account, or for each client IP address when no account resolved, on the gateway:bot_info bucket.