Skip to content
Fluxer API

Gateway

Bots call this endpoint to get the URL for the Gateway WebSocket. User clients get the same URL from endpoints.gateway in instance discovery.

FieldTypeDescription
urlstringThe ws or wss Gateway URL
shardsintegerRecommended shard count, always 1
session_start_limitsession start limit objectSession start values, the same on every call

Add the connection parameters to url before you connect. To split a bot across more than one shard, follow sharding.

{
"url": "wss://gateway.example.com",
"shards": 1,
"session_start_limit": {
"total": 1000,
"remaining": 999,
"reset_after": 14400000,
"max_concurrency": 1
}
}

The API returns the same values on every call, and the Gateway doesn't use them. The limits it enforces are under Session lifecycle.

FieldTypeDescription
totalintegerAlways 1000
remainingintegerAlways 999
reset_afterintegerAlways 14400000 (four hours, in milliseconds)
max_concurrencyintegerAlways 1
GET/v1/gateway/botBot

Returns a Gateway information object. The Authorization header takes Bot <token>, Bearer <token> or the bare token. The API only checks that the token looks like a bot token, and it returns 200 for a revoked or wrong one. To test whether a token works, call Get bot application.

StatusBodyCondition
200Gateway information objectThe token looks like a bot token
401error responseMISSING_AUTHORIZATION with no token, INVALID_AUTH_TOKEN when the token doesn't look like a bot token

The rate limit is 60 requests per minute for each bot, or for each client IP address when the request has no working Bot token, on the gateway:bot_info bucket.