Skip to content

Server Session

GET
/server/v1/session
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 answers idle.
  • 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.

serverCode
Servercode
string
default: 0
matchId
Matchid
integer
0

What to do next

Media typeapplication/json
SessionAnswer

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
action
required
Action

Idle | wait | host | abort

string
region
required
Region
string
queuedInRegion
required
Queuedinregion
integer
matchId
Any of:
integer
reason
Any of:
string
waiting_on
Any of:
Array<string>
selection_ends_at
Any of:
integer
match
Any of:
object
key
additional properties
any
options
Any of:
object
key
additional properties
any
picked
Any of:
object
key
additional properties
any
Examplegenerated
{
"action": "example",
"region": "example",
"queuedInRegion": 1,
"matchId": 1,
"reason": "example",
"waiting_on": [
"example"
],
"selection_ends_at": 1,
"match": {},
"options": {},
"picked": {}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}