Info

Host side

  1. POST /lobby/sessions - name, version, optional public_address, public_port, max_players (32 when left out), data (any string, e.g. JSON, up to 262,144 characters, else 413 too_large), visibility, friends, groups, group_ids, debug. Name, version and address are cut at 256 characters. Takes Idempotency-Key
  2. POST /lobby/sessions/{code}/heartbeat - send it before expires_at (30 s after the last heartbeat or update by default), or the session ends. Returns the next expires_at, while someone takes its server over also ending_at and taken_over_by (see Hosted servers)
  3. PATCH /lobby/sessions/{code} - any of name, data, current_players, players, visibility, friends, groups, group_ids. Leave a field out to keep it, send group_ids: [] for no picked groups. Counts as a heartbeat and answers like one, with the session
  4. DELETE /lobby/sessions/{code} - when the host stops. Answers 204

Player tickets

  1. The player: POST /lobby/tickets with an optional join_code. Answers 201 with ticket (sht_…) and expires_at (2 minutes)
  2. The player hands the ticket to the host over the game connection
  3. The host: POST /lobby/sessions/{code}/players with ticket and X-Session-Secret. Answers user_id and name, the name others see