Events and webhooks

Instead of asking again and again, let your bot hear what happens to your team. Two ways, the same events: read GET /api/v1/team/events (scope events.read), or add a webhook in Team Settings and the league calls your address. Events are kept 14 days.

The events

The events a team hears about
EventWhen
slot.postedYour team posted a slot.
slot.joinedA team took a seat in one of your slots, or you took one in theirs.
slot.withdrawnA team left a slot your team is in.
match.lockedThe third team joined and the slot became a match.
match.changedThe map, zone, weather, factions or host of a match changed.
match.withdrawnA team withdrew from a locked match. The reason is not sent.
match.cancelledStaff cancelled a match. The reason is not sent.
match.confirmedThe result of a match counts. A result read from the game counts as soon as the league reads it after the match. Sent again when league staff uphold or correct a disputed result.
match.ratedA result that counts moved the Elo Ratings. Sent again when a disputed result counts again.
match.statsThe player stats of a match were built or changed. Read them from GET /api/v1/team/matches/{number}. Building the same stats again sends nothing.
match.disputedA team disputed a match: its result does not count until league staff settle it. Who disputed it and why are not sent.
match.settledLeague staff settled a disputed match: upheld, corrected or cancelled. The match says how it stands now; a cancelled one reads null.
application.submittedSomeone applied to join. Only the application id is sent: read the person with the applications scope.

The event object

data holds the slot or match drawn as the other routes draw it, as it stands when you read or receive it (null once it is gone, for example a slot that became a match). A new application carries only its id: read the person with the applications scope. A reason a team gave for withdrawing, a staff note and server details are never in an event.

  • idinteger

    Increases with every event; use it as the cursor

  • typestring

    One of the event types listed in the handbook

  • createdAtstring (date-time)

    When it happened. UTC, ISO 8601

  • teamstring

    Slug of the team it is for

  • dataobject

    What it is about

    3 fields in data
    • slotobject or nullmay be absent

      The slot, for slot.* events; null once it is gone

      15 fields in data.slot
      • idstring

        Slot id; /matches?slot=<id> on the site

      • startsAtstring (date-time)

        When the match would start. UTC, ISO 8601

      • regionstring

        Competitive region code: EU, NA, SA, ASIA, OCE or MEA

      • mapstring

        Map id, the game’s own, or random

      • mapNamestring

        The map’s name as the website shows it; Random for a random map

      • layerstring or null

        Zone key; null for none

      • zonestring or null

        The zone as the website shows it ("Random zone" when none was picked); null for a random map

      • weatherstring or null

        Weather key (clear, overcast, rain, fog, storm), or null for any

      • seatsFilledinteger

        Teams in it so far, of three

      • seatsFreeinteger

        Seats still open, of three

      • hoststring

        Slug of the team that posted it

      • teamsarray of object

        The teams in it so far, the poster first, with names and tags

        3 fields in data.slot.teams
        • slugstring

          The team’s address on the site (/teams/<slug>): its id here

        • namestring or null

          Team name; null if it is gone

        • tagstring or null

          Team tag; null if it is gone

      • yoursboolean

        Whether your team is one of the teams in it

      • privateboolean

        Whether it is an invitation only slot. You only see one you posted or were invited to

      • joinedTeamstring or null

        Slug of the second team; null while that seat is free

    • matchobject or nullmay be absent

      The match, for match.* events; null if it is gone

      19 fields in data.match
      • numberstring

        The match number, as on the website

      • statusstring

        scheduled (locked, not played), reported (played, nothing counts yet: no result, or one that waits to be confirmed), confirmed (the result counts) or disputed (a team disputed it: nothing counts until league staff settle it). A result read from the game is confirmed as soon as the league reads it, and can still become disputed until disputeUntil

      • ratedboolean

        Whether the result is moving Elo now. False again while the match is disputed

      • regionstring

        Competitive region code: EU, NA, SA, ASIA, OCE or MEA

      • mapstring

        Map id, the game’s own: kavkazi, europe, north-america or sabatulo

      • mapNamestring

        The map’s name as the website shows it, for example Zestafona for north-america

      • layerstring or null

        Zone key as stored on the match; null for Random or none

      • zonestring or null

        The zone as the website shows it. "Random zone" when no zone was picked or rolled; null only when the map itself is Random

      • weatherstring or null

        Weather key (clear, overcast, rain, fog, storm), or null for any

      • seasonstring or null

        Name of the season the match belongs to; null when none was running

      • startsAtstring (date-time)

        When it starts. UTC, ISO 8601

      • concludedAtstring (date-time) or null

        When the result that counts was confirmed: set with status confirmed, null otherwise (and again while disputed). It moves when league staff settle a dispute. UTC, ISO 8601

      • disputeUntilstring (date-time) or null

        Set while the result already counts and a team can still dispute it: the end of that window. Null otherwise. UTC, ISO 8601

      • durationSecondsinteger or null

        How long it was played, in seconds; null when unknown

      • hoststring or null

        Team slug of the host; null when no team hosts (a GWL official server, or the host team is gone)

      • sidesarray of object

        The three teams, host first

        6 fields in data.match.sides
        • teamobject

          A team, by slug, name and tag

          3 fields in data.match.sides.team
          • slugstring

            The team’s address on the site (/teams/<slug>): its id here

          • namestring or null

            Team name; null if it is gone

          • tagstring or null

            Team tag; null if it is gone

        • factionstring or null

          Faction code once a moderator assigns one, else null

        • scorenumber or null

          The side’s in-game score, 0 to 100; null before a result

        • placementinteger or null

          1, 2 or 3; null before a result

        • pointsnumber or null

          Placement points for the match: 5 for 1st, 3 for 2nd, 1 for 3rd. They count only while the status is confirmed

        • eloDeltanumber or null

          Elo change from this match as it counts now; null while it is not rated, a disputed match included

      • lockedAtstring (date-time) or null

        When the third team joined and it became a match. UTC, ISO 8601

      • serverPostedboolean

        Whether server details have been posted. This route never returns them: see /team/matches/{number}/server

      • readyTeamsarray of string

        Slugs of the teams that pressed Ready

    • applicationIdstringmay be absent

      The application, for application.submitted

Add a webhook

  1. In Team Settings, Webhooks, add your address and pick the events. It needs Manage API keys. A team can have 3.
  2. Keep the secret, which starts whsec_. It is shown once. New secret makes another and ends the old one.
  3. Press Send test. It sends one event of type ping, with id 0 and empty data, and shows what your address answered.

The address must be https on port 443, with a public domain name: not an IP address or an internal name, and with no sign-in in it.

Delivery

  • Events go out one at a time, in order.
  • Answer any 2xx within 5 seconds. Redirects are not followed, and the body of your answer is not read.
  • Anything else is tried again: after 30 seconds, doubling up to 1 hour. After 10 misses in a row the webhook pauses and says why in Team Settings. Resume carries on where it stopped, so nothing is skipped.
  • Delivery is at least once: use the event id to ignore one you have already handled.
  • Nothing from before a webhook was made is sent. The feed looks back, but only 14 days, and no further than 19 November 2026, when events began. Read booked matches from /api/v1/team/fixtures.
A delivery (invented data)
POST /your/webhook HTTP/1.1
content-type: application/json
user-agent: GWL-Webhooks/1
GWL-Event: slot.posted
GWL-Delivery: 1
GWL-Timestamp: 1800000000
GWL-Signature: v1=<64 hex characters>

{
  "id": 1,
  "type": "slot.posted",
  "createdAt": "2027-01-13T20:00:00.000Z",
  "team": "test-team",
  "data": {
    "slot": {
      "id": "test-slot-01",
      "startsAt": "2027-01-18T19:00:00.000Z",
      "region": "EU",
      "map": "sabatulo",
      "mapName": "Sabatulo",
      "layer": "Default",
      "zone": "Hospital - Default",
      "weather": "fog",
      "seatsFilled": 1,
      "seatsFree": 2,
      "host": "test-team",
      "teams": [
        {
          "slug": "test-team",
          "name": "Test Team",
          "tag": "TEST"
        }
      ],
      "yours": true,
      "private": false,
      "joinedTeam": null
    }
  }
}

Checking a webhook is from the league

GWL-Signature is v1= and the hex HMAC-SHA256 of the GWL-Timestamp header, a dot and the exact body. The key is your whole secret, whsec_ included. Check the raw body before you parse it, compare in constant time, and refuse a timestamp more than 5 minutes off. Each attempt is signed afresh.

Node.js
import { createHmac, timingSafeEqual } from 'node:crypto'

// rawBody: the request body exactly as received, before any JSON parsing
export function isFromGwl(headers, rawBody, secret) {
  const timestamp = Number(headers['gwl-timestamp'])
  // Written this way round so a missing timestamp (NaN) is refused too
  const age = Math.abs(Date.now() / 1000 - timestamp)
  if (!(age <= 300)) return false
  const expected = Buffer.from(
    'v1=' +
      createHmac('sha256', secret).update(timestamp + '.' + rawBody).digest('hex'),
  )
  const given = Buffer.from(String(headers['gwl-signature'] ?? ''))
  // Compare lengths in bytes: timingSafeEqual throws when they differ
  return given.length === expected.length && timingSafeEqual(given, expected)
}
Python
import hashlib
import hmac
import time


# headers: your framework's headers, looked up without regard to case
# raw_body: the request body as bytes, before any JSON parsing
def is_from_gwl(headers, raw_body: bytes, secret: str) -> bool:
    try:
        timestamp = int(headers.get("GWL-Timestamp", ""))
    except ValueError:
        return False
    if abs(time.time() - timestamp) > 300:
        return False
    signed = str(timestamp).encode() + b"." + raw_body
    expected = "v1=" + hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    given = headers.get("GWL-Signature", "")
    return hmac.compare_digest(expected.encode(), given.encode())
A whole receiver, in Node.js
import { createServer } from 'node:http'
import { isFromGwl } from './verify.js'

const seen = new Set() // keep this somewhere that survives a restart

createServer(async (req, res) => {
  const chunks = []
  for await (const chunk of req) chunks.push(chunk)
  const raw = Buffer.concat(chunks).toString('utf8')

  if (!isFromGwl(req.headers, raw, process.env.GWL_WEBHOOK_SECRET)) {
    res.writeHead(401).end()
    return
  }
  res.writeHead(204).end() // answer first, then do the work

  const event = JSON.parse(raw)
  if (event.type === 'ping' || seen.has(event.id)) return
  seen.add(event.id)
  console.log(event.type, event.data)
}).listen(8080)