Webhooks
Receive ScalPanel alerts and account events as signed JSON on your own HTTPS endpoint, or in Slack, Discord or Telegram.
ScalPanel sends alerts and changes to webhooks: when an alert starts and resolves, and when an account, website, domain, database, mail domain, mailbox or certificate is created, changed or removed, it POSTs a signed JSON message to an address you choose. Use them to open tickets, page someone, keep a billing system or a CRM in step, or feed your own monitoring. Failed deliveries are retried.
Add a webhook
You need the alerts.manage permission.
- Open Statistics → Alerts in the hosting panel, or System health → Alerts in the admin panel.
- In Webhooks, select Add webhook.
- Choose the kind: a plain webhook, Slack, Discord or Telegram.
- Enter the address (for Telegram: the bot token and the chat), and an optional label.
- Under Send, choose the alerts and the events it receives (alerts only by default).
- Select Add webhook. For a plain webhook, copy the signing secret now: it is shown only once.
- Select Send test to check that your endpoint receives the
testevent.
Each account can have at most 5 webhooks. Each one can be turned off without deleting it, and its page shows the recent deliveries with their status and answer code.
Address rules
A plain webhook's address must:
- use
https://; - use port 443, 80, 8443 or 8080;
- resolve to a public address (never loopback, private, link-local or other reserved ranges, checked again at every connection);
- have no user name, password or
#fragment, and be at most 2048 characters long.
Events
| Event | Sent when |
|---|---|
alert.firing | An alert starts. Not sent if someone acknowledged the alert before it went out. |
alert.resolved | An alert that was announced with alert.firing resolves. |
test | You select Send test. |
Account and resource events
A webhook subscribed to them receives these events for its own account, or for every account below a reseller or the provider. GET /v1/webhook-events lists the names.
| Event | Sent when |
|---|---|
account.created, account.package_changed, account.suspended, account.unsuspended, account.terminated | An account is made, changes package, is suspended or unsuspended, or is terminated |
site.created, site.deleted | A website is made or deleted |
domain.added, domain.removed | A domain is added to or removed from a website |
certificate.issued | A certificate is issued |
database.created, database.deleted | A database is made or deleted |
mail_domain.created, mail_domain.deleted, mailbox.created, mailbox.deleted | Email is set up or removed |
backup.restore_started | A restore is started |
Events are sent about 30 seconds after the change, at most once each. Their data names what changed, not its details; read those through the API with the IDs:
{
"id": "whd_01JC4M2Q7Z8X1V5N3B6K9D0F2H",
"event": "site.created",
"created_at": "2026-11-16T09:30:31Z",
"data": {
"tenant_id": "acct_01JC1A2B3C4D5E6F7G8H9J0K1M",
"target": { "type": "site", "id": "site_01JC4M2Q5Y7W0T3R6P9M2K5H8G" },
"actor": "user",
"occurred_at": "2026-11-16T09:30:00Z",
"audit_event_id": "evt_01JC4M2Q5Y7W0T3R6P9M2K5H8F"
}
}
The alert.kind field tells you what happened:
| Kind | Severity | Subject |
|---|---|---|
site_down | critical | An uptime monitor |
site_failed | critical | A website that failed to start |
certificate_expiring | warning | A domain |
backup_failed | warning | A website or database |
cron_failing | warning | A cron job that keeps failing |
disk_quota | warning | The account, near its disk limit |
mail_sending_blocked | critical | A mailbox whose sending was stopped |
leech | warning | A protected folder whose login is used from many addresses |
offsite_failed | critical or warning | An off-site backup run (provider only) |
rule | warning | A website crossing one of your alert rules |
node_offline | critical | A server (provider only) |
node_disk | warning | A server's disk (provider only) |
backup_check_failed | critical | The provider's backups (provider only) |
Payload
Every delivery is a POST with Content-Type: application/json and this body:
{
"id": "whd_01JC4M2Q7Z8X1V5N3B6K9D0F2H",
"event": "alert.firing",
"created_at": "2026-11-14T09:30:00Z",
"data": {
"alert": {
"id": "alrt_01JC4M2Q5Y7W0T3R6P9M2K5H8G",
"tenant_id": "acct_01JC1A2B3C4D5E6F7G8H9J0K1M",
"kind": "site_down",
"severity": "critical",
"title": "…",
"subject_type": "uptime_monitor",
"subject_id": "…",
"value": null,
"state": "firing",
"started_at": "2026-11-14T09:29:41Z",
"resolved_at": null
},
"url": "https://panel.example.com"
}
}
valueis the measured number when there is one (for example a percentage), otherwisenull.resolved_atis set onalert.resolved.urlis the panel's address, when the server has one configured.- The
testevent'sdatais{"tenant_id": "…", "message": "This is a test event."}.
Plain webhooks also get these headers:
| Header | Value |
|---|---|
X-ScalPanel-Event | The event name |
X-ScalPanel-Delivery | The delivery ID, the same on every retry |
X-ScalPanel-Signature | t=<unix time>,v1=<hex HMAC-SHA256> |
User-Agent | ScalPanel-Webhook/1 |
Slack, Discord and Telegram get a readable message in their own format instead, without these headers.
Verify the signature
The signature is an HMAC-SHA256, keyed with your webhook's secret (whsec_…), over the timestamp, a dot, and the raw request body: <t>.<body>. Always check it before you trust a delivery, and compare in constant time.
Python:
import hashlib, hmac, time
def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
ts, sig = parts.get("t", ""), parts.get("v1", "")
if not ts.isdigit() or abs(time.time() - int(ts)) > tolerance:
return False
expected = hmac.new(secret.encode(), ts.encode() + b"." + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sig)
Pass the body exactly as received, before any JSON parsing. The timestamp is the time of each attempt, so a tolerance of a few minutes rejects replayed messages without rejecting retries.
Bash with OpenSSL, for a quick manual check:
# $T and $SIG come from the X-ScalPanel-Signature header, body.json is the raw body
printf '%s.' "$T" | cat - body.json \
| openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" -hex | awk '{print $NF}'
# The output must equal $SIG
Retries and timeouts
- Your endpoint must answer with a
2xxstatus within 10 seconds. Anything else is a failure, including a redirect: redirects are not followed. - A failed delivery is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours: six attempts in all. After the last one it is marked failed.
- The answer's body is ignored.
- Deliveries can arrive more than once or out of order. Use
X-ScalPanel-Deliveryto ignore repeats, and the alert'sstateand times rather than the arrival order. - Delivery history is kept for 30 days.
Tip: Answer quickly with 200 and do the slow work afterwards, so a busy receiver does not cause timeouts and retries.