Skip to content
FiveCord Docs

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.

Every field is always present.

FieldTypeDescription
urlstringThe ws or wss URL, identical to endpoints.gateway in instance discovery
shardsintegerRecommended shard count, always 1
session_start_limitsession start limit objectFixed 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.

{
"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.

These are fixed compatibility values, not live usage counters.

FieldTypeDescription
totalintegerReported session starts allowed, always 1000
remainingintegerReported session starts remaining, always 999
reset_afterintegerReported reset interval in milliseconds, always 14400000 (four hours)
max_concurrency1integerReported 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/v1/gateway/botBot

Returns 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.

StatusBodyCondition
200Gateway information objectThe credential is in bot token form
4011error responseThe 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

Use the Bot authorisation prefix. Repeated invalid authentication can trigger the abuse protections.

60 requests per minute for each authenticated account, or for each client IP address when no account resolved, on the gateway:bot_info bucket.