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.

  1. Open Statistics → Alerts in the hosting panel, or System health → Alerts in the admin panel.
  2. In Webhooks, select Add webhook.
  3. Choose the kind: a plain webhook, Slack, Discord or Telegram.
  4. Enter the address (for Telegram: the bot token and the chat), and an optional label.
  5. Under Send, choose the alerts and the events it receives (alerts only by default).
  6. Select Add webhook. For a plain webhook, copy the signing secret now: it is shown only once.
  7. Select Send test to check that your endpoint receives the test event.

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

EventSent when
alert.firingAn alert starts. Not sent if someone acknowledged the alert before it went out.
alert.resolvedAn alert that was announced with alert.firing resolves.
testYou 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.

EventSent when
account.created, account.package_changed, account.suspended, account.unsuspended, account.terminatedAn account is made, changes package, is suspended or unsuspended, or is terminated
site.created, site.deletedA website is made or deleted
domain.added, domain.removedA domain is added to or removed from a website
certificate.issuedA certificate is issued
database.created, database.deletedA database is made or deleted
mail_domain.created, mail_domain.deleted, mailbox.created, mailbox.deletedEmail is set up or removed
backup.restore_startedA 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:

KindSeveritySubject
site_downcriticalAn uptime monitor
site_failedcriticalA website that failed to start
certificate_expiringwarningA domain
backup_failedwarningA website or database
cron_failingwarningA cron job that keeps failing
disk_quotawarningThe account, near its disk limit
mail_sending_blockedcriticalA mailbox whose sending was stopped
leechwarningA protected folder whose login is used from many addresses
offsite_failedcritical or warningAn off-site backup run (provider only)
rulewarningA website crossing one of your alert rules
node_offlinecriticalA server (provider only)
node_diskwarningA server's disk (provider only)
backup_check_failedcriticalThe 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"
  }
}
  • value is the measured number when there is one (for example a percentage), otherwise null.
  • resolved_at is set on alert.resolved.
  • url is the panel's address, when the server has one configured.
  • The test event's data is {"tenant_id": "…", "message": "This is a test event."}.

Plain webhooks also get these headers:

HeaderValue
X-ScalPanel-EventThe event name
X-ScalPanel-DeliveryThe delivery ID, the same on every retry
X-ScalPanel-Signaturet=<unix time>,v1=<hex HMAC-SHA256>
User-AgentScalPanel-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 2xx status 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-Delivery to ignore repeats, and the alert's state and 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.