Webhooks
A webhook sends your PingTurret alerts to another app. When a monitor goes down, comes back up, or its SSL certificate is about to expire, we send a message to an address you choose. Webhooks are included in the Pro and Business plans. Add one under Alert contacts → Webhook.
Slack
- Go to api.slack.com/apps, choose Create New App → From scratch, name it PingTurret and pick your workspace.
- Open Incoming Webhooks, switch it on, click Add New Webhook to Workspace and choose the channel.
- Copy the address (it starts with
https://hooks.slack.com/services/) and paste it into PingTurret.
Alerts arrive as formatted messages with a colored bar and a link to the monitor.
Discord
- Open the channel's settings (the gear next to its name) → Integrations → Webhooks → New Webhook.
- Click Copy Webhook URL and paste it into PingTurret.
Microsoft Teams, Zapier, Make, n8n and others
Any other address gets the alert as a JSON event (see below), which these tools can turn into anything: a Teams or SMS message, a ticket, a row in a spreadsheet, a phone call through an on-call service.
- Microsoft Teams: in Power Automate, create a flow that starts with When an HTTP request is received, then add Post message in a chat or channel using the fields
messageandmonitor.url. Paste the flow's address into PingTurret. - Zapier: start a Zap with Webhooks by Zapier → Catch Hook and paste its address.
- Make: start a scenario with Webhooks → Custom webhook and paste its address.
- n8n: add a Webhook node with method POST and paste its production URL.
- Your own server: accept a POST request with a JSON body and answer with any 2xx status.
When you add the webhook, we send a test event straight away. Most tools use it to learn the fields.
Events
monitor.down: a monitor is down (confirmed from a second location).details:reason,started_at, and when knownstatus_code,response_ms,seen_from,cause(for exampleorigin,dns_down,ssl_expired),cause_textandcontact.monitor.up: it's back.details:downtime_seconds,downtime(e.g. "12m 30s"),recovered_at.ssl.expiring: the SSL certificate expires soon.details:expires_at,days_left.test: sent when the webhook is added and from Send test.monitorisnull.
Example of a monitor.down event:
{
"event": "monitor.down",
"message": "🔴 Shop is DOWN",
"monitor": {
"id": "0ef2uxl",
"name": "Shop",
"type": "http",
"target": "https://shop.example.com",
"url": "https://www.pingturret.com/monitor.php?id=0ef2uxl"
},
"details": {
"reason": "Connection timed out after 15s",
"started_at": "2026-11-17T10:42:00Z"
},
"occurred_at": "2026-11-17T10:42:00Z",
"delivery_id": "5f0c2a9e1b7d4c3a8e6f1d22"
} Times are in UTC (ISO 8601). delivery_id stays the same when a delivery is retried, so you can ignore duplicates.
Headers
Content-Type: application/jsonX-PingTurret-Event: the event nameX-PingTurret-Delivery: the delivery idX-PingTurret-Signature:t=<unix time>,v1=<signature>
Checking the signature
Each JSON webhook has a signing secret (it starts with whsec_), shown under the webhook on the Alert contacts page. The signature is an HMAC-SHA256, in hex, of the time, a dot and the raw request body, made with that secret. Compare it with your own calculation, and reject requests whose time is more than 5 minutes old.
PHP
$body = file_get_contents('php://input');
$secret = 'whsec_...';
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_PINGTURRET_SIGNATURE'] ?? ''), $sig);
$expected = hash_hmac('sha256', ($sig['t'] ?? '') . '.' . $body, $secret);
if (!hash_equals($expected, $sig['v1'] ?? '') || abs(time() - (int)($sig['t'] ?? 0)) > 300) {
http_response_code(401);
exit;
}
$event = json_decode($body, true); Node.js (Express, with the raw body)
const crypto = require('crypto');
app.post('/pingturret', express.raw({ type: 'application/json' }), (req, res) => {
const sig = Object.fromEntries((req.get('X-PingTurret-Signature') || '').split(',').map(p => p.split('=')));
const expected = crypto.createHmac('sha256', process.env.PT_SECRET).update(sig.t + '.' + req.body).digest('hex');
const ok = sig.v1 && expected.length === sig.v1.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig.v1));
if (!ok || Math.abs(Date.now() / 1000 - sig.t) > 300) return res.sendStatus(401);
const event = JSON.parse(req.body);
res.sendStatus(204);
}); Python
import hmac, hashlib, time
def valid(raw_body: bytes, header: str, secret: str) -> bool:
sig = dict(p.split("=", 1) for p in header.split(","))
expected = hmac.new(secret.encode(), f"{sig['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sig.get("v1", "")) and abs(time.time() - int(sig["t"])) < 300
Delivery and retries
- Answer with any 2xx status within 10 seconds. Redirects aren't followed.
- If your end is down or answers 5xx or 429, we try again: up to 6 times over about half an hour, waiting longer each time (and as long as a
Retry-Afterheader asks). - Answers 400, 401, 403, 404 and 410 mean the address is wrong or removed: we stop retrying and mark the webhook as Delivery failing on the Alert contacts page, and you can fix it there.
- Webhooks can only be sent to public internet addresses, not to private or local networks.