# Webhooks & events

Instead of polling, let Arenyze call you. Add a destination in the [Workbench → Webhooks](https://workbench.arenyze.com/#/live/webhooks) , choose the events and the players, and receive signed JSON within minutes of the change — or a ready-made message on Discord, Slack or Telegram.

## How it works

- Watch players. Each endpoint lists the players it follows (THE FINALS name, R6 name + platform, Endfield UID). Leave the list empty to receive the global feeds (THE FINALS renames and bans).

- Arenyze checks them — R6 every 5 min, THE FINALS every 10 min, Endfield every 30 min — and compares with the last state.

- A change becomes an event and is POSTed to your endpoint, signed. Failed deliveries are retried for 24 hours.

## Payload

Every delivery is a `POST` with a JSON body:

POST body:

```json
{
  "id": "evt_10423",
  "type": "thefinals.league_changed",
  "game": "thefinals",
  "player": "balise#2431",
  "occurred_at": "2026-11-03T00:16:57.000Z",
  "data": {
    "player": "balise#2431",
    "display": "Balise#2431",
    "url": "https://thefinals.arenyze.com/player/Balise%232431",
    "from": "Diamond 2",
    "to": "Diamond 1",
    "direction": 1,
    "rank": 47,
    "score": 54011
  },
  "text": "Balise#2431 moved from Diamond 2 to Diamond 1."
}
```

| Header | Value |

| `Arenyze-Signature` | `t=,v1=` |

| `Arenyze-Event` | The event type. |

| `Arenyze-Delivery` | Unique delivery id (use it to de-duplicate). |

| `User-Agent` | `Arenyze-Webhooks/1.0` |

## Discord, Slack and Telegram

When the destination URL is a Discord webhook (`https://discord.com/api/webhooks/…`), a Slack incoming webhook (`https://hooks.slack.com/services/…`) or a Telegram bot URL (`https://api.telegram.org/bot<token>/sendMessage?chat_id=<id>`), Arenyze sends a ready-made message in that service's format instead of the JSON envelope above: title, description, the changed values and a link to the player.

These services do not check signatures, so you do not need the signing secret anywhere: paste the URL, press Send test event and the message appears in the channel. The secret is only for your own server, where you verify it as shown below.

For messages on a schedule (a daily or hourly summary of a player) or with conditions and cooldowns, use [Arenyze Flows](https://docs.arenyze.com/flows) .

## Verifying the signature

Compute HMAC-SHA256 of `<t>.<raw body>` with the endpoint secret (`whsec_…`, shown once when you create or rotate it) and compare with `v1`. Reject timestamps older than 5 minutes.

```js
import crypto from "node:crypto";
import express from "express";

const app = express();
app.post("/arenyze", express.raw({ type: "application/json" }), (req, res) => {
  const sig = req.get("Arenyze-Signature") || "";
  const { t, v1 } = Object.fromEntries(sig.split(",").map(p => p.split("=")));
  const expected = crypto.createHmac("sha256", process.env.ARENYZE_WEBHOOK_SECRET)
    .update(`${t}.${req.body}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
  if (!fresh || !v1 || !crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))) {
    return res.status(400).send("bad signature");
  }
  const event = JSON.parse(req.body);
  console.log(event.type, event.text);
  res.sendStatus(204); // answer fast; do the work async
});
```

```python
import hmac, hashlib, os, time
from flask import Flask, request, abort

app = Flask(__name__)
SECRET = os.environ["ARENYZE_WEBHOOK_SECRET"].encode()

@app.post("/arenyze")
def arenyze():
    parts = dict(p.split("=", 1) for p in request.headers.get("Arenyze-Signature", "").split(","))
    body = request.get_data()
    expected = hmac.new(SECRET, f"{parts.get('t')}.".encode() + body, hashlib.sha256).hexdigest()
    if abs(time.time() - int(parts.get("t", 0))) > 300 or not hmac.compare_digest(expected, parts.get("v1", "")):
        abort(400)
    event = request.get_json()
    print(event["type"], event["text"])
    return "", 204
```

## Retries & health

- Any `2xx` within 8 seconds is a success. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h.

- `404` and `410` stop the retries at once.

- After 15 failed deliveries in a row the endpoint is disabled and you get a notification. Enable it again from the panel.

- The panel shows the last 50 deliveries with status code and timing, and can re-send any of them or a test event (`arenyze.test`).

- Targets must be public HTTPS hosts; private and internal addresses are refused.

## Event catalogue

`r6.rank_changed`Rainbow Six
The ranked tier changed (e.g. Emerald → Diamond).

data:

```json
{
  "from": {
    "rank": "Emerald I",
    "rp": 3980
  },
  "to": {
    "rank": "Diamond V",
    "rp": 4012,
    "kd": "1.21"
  },
  "delta": 32
}
```

`r6.rp_changed`Rainbow Six
RP changed — a ranked match was played.

data:

```json
{
  "from": {
    "rank": "Gold II",
    "rp": 2710
  },
  "to": {
    "rank": "Gold II",
    "rp": 2734,
    "kd": "1.05"
  },
  "delta": 24
}
```

`thefinals.rank_changed`THE FINALS
Position or score on the live Ranked board changed.

data:

```json
{
  "from": {
    "rank": 61,
    "score": 53210
  },
  "to": {
    "rank": 47,
    "score": 54011,
    "league": "Diamond 1"
  },
  "rankDelta": 14
}
```

`thefinals.league_changed`THE FINALS
League changed. `direction` is 1 up, -1 down.

data:

```json
{
  "from": "Diamond 2",
  "to": "Diamond 1",
  "direction": 1,
  "rank": 47,
  "score": 54011
}
```

`thefinals.club_changed`THE FINALS
Joined, left or switched club (`null` = no club).

data:

```json
{
  "from": "BERGR",
  "to": "VGG"
}
```

`thefinals.renamed`THE FINALS
Embark name changed. Watched players, or every rename with the global feed.

data:

```json
{
  "from": "Balise#9424",
  "to": "Balise#2431",
  "global": true
}
```

`thefinals.ban_detected`THE FINALS
Removed from the leaderboards. Watched players, or the global feed.

data:

```json
{
  "banType": "removed",
  "banTypeLabel": "Removed from the leaderboard",
  "status": "suspected",
  "lastRank": 6647,
  "lastLeague": "Platinum 2",
  "season": "s12",
  "global": true
}
```

`endfield.level_changed`Endfield
Authority level changed.

data:

```json
{
  "from": 52,
  "to": 53
}
```

`endfield.world_level_changed`Endfield
World level changed.

data:

```json
{
  "from": 5,
  "to": 6
}
```

`endfield.operators_changed`Endfield
Number of operators on the account changed.

data:

```json
{
  "from": 21,
  "to": 22
}
```

---

Source: https://docs.arenyze.com/webhooks · Markdown: https://docs.arenyze.com/webhooks.md · All docs for LLMs: https://docs.arenyze.com/llms.txt
