Telemetry API
For whoever maintains the service. If you're putting telemetry in a game, you want Adding it to a game instead. You don't need any of this.
Base URL: https://telemetry-api.ardenttitanite.com. The bare name,
telemetry.ardenttitanite.com, serves the landing page. A game that posts there
gets an HTML page back and reports nothing while looking healthy.
Auth: an X-Telemetry-Key header on every route except GET /health. The
service checks the key before it reads the body, so a wrong key gets 401 even
when the body is malformed. A body over 1 MB gets 413.
Two keys, and they must differ:
| Key | Held by | Used for |
|---|---|---|
INGEST_KEY | Every game, through one shared secret | Sending segments, registering the game, and the game gateway |
READ_KEY | The CMS and the telemetry dashboard | Reading the numbers, and managing the activity rules |
The read key does more than read. It creates, changes and deletes activity rules, and it fires test posts to Discord. It can't send segments, so a leaked read key can't forge activity.
GET /health
No key needed. Answers {ok: true}. This is the health check.
POST /v1/segments
{
"eventId": "a-guid-generated-once-per-batch",
"gameKey": "genesius",
"placeId": "137231719757604",
"jobId": "server-job-id",
"serverTime": 1785735243003,
"segments": [
{
"robloxId": "1234567890",
"username": "Someone",
"team": "Blue",
"startedAt": 1785734043003,
"endedAt": 1785735243003,
"reason": "leave"
}
]
}
A batch holds at most 200 segments, and eventId is at most 100 characters.
userId works as another name for robloxId. username and team are cut to
64 characters and reason to 32.
| Response | Means |
|---|---|
201 {accepted, duplicate: false, stored, excluded} | Stored. stored counts every segment kept and excluded counts the ones flagged |
200 {accepted, duplicate: true, stored: 0, excluded: 0} | Already had this eventId. Nothing counted twice. |
400 | Malformed. The message says how. Retrying won't help. |
401 | Wrong key. |
403 | The game isn't registered, or it has been disabled. |
413 | The body is over 1 MB. |
Reuse eventId when retrying. That's the whole idempotency story. The
sender never has to know whether its first attempt landed.
robloxId is a string. A Roblox ID above 2^53 rounds as a JSON number, and a
rounded ID writes one player's session onto someone else's account.
POST /v1/games
Register a game. A game has to be registered before it can report, so one game can be switched off without rotating everyone's key.
{ "gameKey": "genesius", "label": "GENESIUS Territory", "placeId": "137231719757604" }
gameKey and label are required. The answer is 201 {gameKey, label}. The
model registers itself every time a server starts, and it sets the label to the
game key, so a label you set by hand lasts until the next server starts.
POST /v1/games/:gameKey/disable
Stops that game reporting. Its existing records are untouched. An unknown game
gets 404.
GET /v1/whoami
?gameKey=<key>, with the ingest key. Answers {gameKey, registered, serverTime}. A game can call it at start-up to check it is wired up.
GET /v1/playtime
?gameKey=genesius&since=<ms>&until=<ms>. Defaults to the last 7 days. Leave
out gameKey to cover every game. The window has no upper limit, and a session
counts by its start time, with no clipping at the edges of the window.
Computed from the raw rows on every request, excluded segments left out. Deliberately not a running total: a total that drifts can't be checked, whereas this can be recomputed and compared against the envelopes it came from.
GET /v1/stats
Envelope, segment, excluded and game counts. It needs a key. The health check
is GET /health.
GET /v1/presence
?gameKey=<key>&since=<ms>&until=<ms>, who was in a game during a window.
This is what turns an event into an attendance sheet without anybody taking a register. It answers who was present, and nothing more. It does not decide who attended: the conditions for that live in Utilities, so the same telemetry can serve two groups that count attendance differently.
Windows longer than a day are refused rather than served slowly. An event window is hours, and a request for a year of a busy game is a mistake worth saying out loud.
A game that has since been disabled still answers here. Its old segments are real, and losing somebody's attendance because the game was switched off afterwards would be a poor trade.
GET /v1/players and /v1/players/:robloxId
The player lookup behind the HQ console.
/v1/players needs q of at least 2 characters. It matches an exact Roblox ID
or any username the player has used, and takes limit (25 by default, 100 at
most). /v1/players/:robloxId needs an ID made of digits and takes limit (500
by default, 2000 at most) and offset.
A 404 on one player means never recorded, which is a different answer from
recorded with no playtime, and the two stay distinguishable.
GET /v1/teams
The teams actually seen in the data, which is what the rule editor offers.
Teams are picked from this list rather than typed, because a rule matching a team name that no game ever reports is a rule that silently never fires.
The activity rules
| Route | Does |
|---|---|
GET /v1/rules | List them |
POST /v1/rules | Create one |
PATCH /v1/rules/:id | Change one |
DELETE /v1/rules/:id | Remove one |
POST /v1/rules/:id/test | Fire one against current data without waiting |
POST /v1/rules needs gameKey, team and webhookUrl, which must be a
Discord webhook. label, minSeconds and createdBy are optional. It answers
201 with the rule, the webhook redacted. An unregistered game gets 400, not
403. PATCH changes only label, minSeconds and enabled. test sends a
message to the webhook and answers 502 if Discord doesn't take it.
A rule points a webhook at a Discord channel, so treat these routes as operator tools.
The game gateway
Three things a game already wanted, and previously could only have by holding a Utilities key of its own. Now telemetry holds the key and the game holds none. A fourth route says whether the other three will work.
| Route | Does |
|---|---|
GET /v1/gateway/status | Will these work? Ask at start-up |
POST /v1/gateway/points | Award points in game |
GET /v1/gateway/events | Is an event running for my group right now |
POST /v1/gateway/applications | Submit an application from in game |
All four take the ingest key. points, events and applications also need
the game to be registered, and answer 403 when it isn't or has been disabled.
status doesn't need registration: it reports whether the game has it.
status exists so a game can find out at start-up whether the capabilities it
depends on will work, rather than discovering it when somebody is standing in a
lobby waiting for points that were never going to arrive. It reports four
things separately: the key you sent, whether the gateway is configured at all,
whether your game is registered, and whether it is authorised.
The gateway passes Utilities' status and body straight through. It adds three
answers of its own: 503 when the gateway isn't configured, 403 with "this
game has no Utilities key" when the game isn't authorised, and 504 when
Utilities is unreachable or doesn't answer within 8 seconds.
Points keep their idempotency keys all the way through. Utilities refuses a
repeated key, so a game retrying a forward it never saw the answer to does not
pay twice. That is the same promise /v1/segments makes about eventId, kept
by the same mechanism one service further along.
The events route does not take an attendance list. The game is told an event is running and nothing else. Presence is already arriving as segments, and asking the game to also report who attended would be asking the same question twice and then trusting the looser answer.
robloxUserId on an application is a string, for the reason robloxId is
on a segment: an id above 2^53 rounds, and a rounded id files one person's
application under somebody else's account.
When a segment gets flagged
| Reason | Rule |
|---|---|
| ends before it starts | endedAt is earlier than startedAt |
| longer than the ceiling | one segment is longer than the service accepts |
| starts in the future | it starts further ahead of the service's clock than it accepts |
| ends further in the past than we accept | it ended long before the service received it |
Flagged segments are stored, excluded from totals, and never deleted.
A batch with a timestamp that isn't a number is a different case. The service
refuses the whole batch with 400 and stores nothing.