Cmdr bridge
Poll for commands
Report a server's players and long-poll for queued Cmdr, kick, warn and announce commands, held open for up to 20 seconds.
https://api.bloxlytics.app/v1/bridge/pollcurl -X POST https://api.bloxlytics.app/v1/bridge/poll \
--max-time 30 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer bxb_…" \
-H "X-Bloxlytics-Project: <universe id>" \
-H "X-Bloxlytics-Timestamp: $(date +%s)" \
-H "X-Bloxlytics-Nonce: $(uuidgen)" \
-d '{
"protocol": 1,
"jobId": "<job id>",
"placeId": 1234567890,
"players": [1, 2, 3],
"tags": { "map": "Forest" },
"studio": false
}'{
"commands": [
{
"id": "<execution id>",
"kind": "cmdr",
"text": "give \"<username>\" 500",
"expiresAt": 1767225660,
"issuedBy": { "id": "<user id>", "name": "<name>", "role": "admin" },
"executorUserId": 1
},
{
"id": "<execution id>",
"kind": "kick",
"userId": 2,
"message": "You were removed from the server.",
"expiresAt": 1767225662,
"issuedBy": { "id": "<user id>", "name": "<name>", "role": "owner" }
}
]
}A long poll. The game server reports who is in it and waits for commands. If commands are waiting, they're returned at once; otherwise the request is held open for up to 20 seconds and returns as soon as a command arrives, or empty when the time is up. Then the server polls again.
Game servers never accept incoming connections, so this is how Bloxlytics reaches them: every command a team member runs from the dashboard is picked up by a poll. Polling also keeps the server listed as online, with an up-to-date player list.
Call hello first, and stop polling if it returned enabled: false. Authentication and replay headers are the same as for every bridge endpoint; see Authentication.
#Headers
Content-Typestringheaderrequiredapplication/json.
AuthorizationstringheaderrequiredBearer followed by the project's bridge key, bxb_….
X-Bloxlytics-ProjectstringheaderrequiredThe experience's Universe ID (game.GameId).
X-Bloxlytics-TimestampstringheaderrequiredThe current Unix time in seconds, within 120 seconds of Bloxlytics' clock.
X-Bloxlytics-NoncestringheaderrequiredA new random value for this request, 16 to 64 characters from A–Z a–z 0–9 - { }.
#Body
protocolnumberbodyrequiredMust be 1.
jobIdstringbodyrequiredThe server's id, up to 64 characters. The same value you sent to hello.
placeIdintegerbodyrequiredgame.PlaceId. A whole number, 0 or more.
playersinteger[]bodydefault: []The Roblox user ids of everyone in the server right now, up to 700, each a positive whole number. Replaces the list from the last poll. Bloxlytics uses it to show who is where and to route commands to the server a player is in.
tagsobjectbodyThe server's current tags, such as { "map": "Forest" }: up to 16, names starting with a letter then letters, digits, spaces, _ . - (up to 32 characters), values up to 64 characters. Omit to keep the tags already known.
studiobooleanbodytrue for a Studio session.
#Response
200 OK with the commands for this server. At most 10 commands come back per poll: first those addressed to this server, and only when there are none of those, commands that any server may run. Bloxlytics normally addresses every command to one server when it's queued.
commandsCommand[]requiredThe commands to run, in the order they were queued. [] when the hold time ran out with nothing to do.
204 No Content is returned instead if the caller closed the connection while the poll was held. A client doesn't normally see it; treat it like an empty poll.
#Timing
- Hold time. Up to 20 seconds (
pollHoldSecondsfrom hello). While a poll is held, Bloxlytics checks for new commands about every 0.4 seconds, so a command reaches a polling server well under a second after it's queued. - Client timeout. Give the request more than 20 seconds, ideally 25 or more, so a normal empty return isn't cut off.
- Next poll. Poll again straight away after each response, after reporting any results. On a failure, back off: the Luau bridge waits 2 seconds, doubling up to 60.
- Online status. Each poll counts as the server being seen. A server that hasn't polled or sent an analytics heartbeat for 90 seconds is no longer shown as online, and commands aren't sent to it.
- Rate limit. 20,000 polls a minute per project. A server polling continuously uses about three a minute when idle.
#Delivery guarantees
- A command is delivered to one poll. Once returned, it's marked as dispatched to this
jobId, and only this server's result is accepted for it. - A command that's past
expiresAtwhen a poll picks it up is not delivered: it's marked as timed out (Expired before a server picked it up.). - If the poll response is lost on the way (for example the connection drops), the command isn't sent again. It's marked as timed out if no result arrives.
#What the server must do
The bridge never runs anything except registered commands, through the game's own code. For every command in the response:
- Skip duplicates. Keep the ids you've run (the Luau bridge keeps them for 10 minutes) and report an id you've already seen as failed, without running it again.
- Check
expiresAtagainstos.time(). If it has passed, don't run it; report it as failed. - Run it.
cmdr: through Cmdr's dispatcher, as theexecutorUserIdplayer if given, otherwise in the system context (or refuse, if the server doesn't allow system commands).kick,warn,announce: only if the server enabled that capability. - Report every outcome in one result request.
See Cmdr bridge security for the full model.