Server Session
const url = 'https://example.com/server/v1/session?serverCode=0&matchId=0';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/server/v1/session?serverCode=0&matchId=0'The one call a game server makes on a loop. Answers what it should be doing.
matchId is the match the server holds, including one it has finished but not yet
reported; 0 means it is free. Matchmaking runs here, so a match is only ever made
for a server standing by to host it.
action is one of:
idle: nothing to do. Ask again shortly.wait: the match is yours but its players are still choosing. Keep sending its id.host: start it. Sent once per match; asking again while hosting answersidle.abort: drop it. Nobody is coming.
A match a server still names is never written off, which is what makes the result report safe to retry indefinitely.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”What to do next
GET /session, the one call a game server makes on a loop.
Documented rather than enforced: this is the only answer here whose shape depends on
action, and a response model would have to list every field as optional, which
would add a null for each one a given answer does not carry. The contract is that a
field is absent, not null, so the model describes the union and the route returns
exactly what it built.
region and queuedInRegion are on every answer, so a region mismatch reads off the
console instead of looking like an empty queue.
object
Idle | wait | host | abort
Examplegenerated
{ "action": "example", "region": "example", "queuedInRegion": 1, "matchId": 1, "reason": "example", "waiting_on": [ "example" ], "selection_ends_at": 1, "match": {}, "options": {}, "picked": {}}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}