Este artigo está disponível só em inglês.

Alertas e notificações

Webhook alerts: JSON payload reference

Receive FastPing alerts on your own HTTPS endpoint: the JSON payload, its fields, delivery rules, how to secure the endpoint and a receiver example.

Última atualização: Leitura de 2 min

Payload

For every alert, FastPing sends an HTTP POST with Content-Type: application/json and the User-Agent FastPing-Monitor/1.0 (+https://fastping.app). The body looks like this:

JSON
{
  "event": "down",
  "monitor": { "id": 12, "name": "Shop", "type": "http", "target": "https://shop.example.com" },
  "detail": "HTTP 503",
  "status": "down",
  "timestamp": "2026-10-17T09:30:00.000Z",
  "url": "https://fastping.app/app/monitors/12"
}
FieldDescription
eventdown, up (recovery or warning cleared), warn or event (a change, such as DNS records or a game server's map)
monitor.idNumeric monitor ID, the same as in the dashboard URL and the REST API
monitor.nameThe monitor's friendly name
monitor.typeMonitor type key, such as http, ssl or game
monitor.targetThe URL or host; an empty string for heartbeat monitors
detailThe message of the check, for example HTTP 503 or Certificate expires in 9 days
statusThe monitor's status after this alert: up, down or warn
timestampWhen the alert was sent, ISO 8601 in UTC
urlLink to the monitor in the dashboard (login required)

The test alert has "event": "event", monitor ID 0 and the name FastPing test, so your code can recognise and ignore it.

Delivery rules

  • The URL must use HTTPS and resolve to a public IP address.
  • Your endpoint must answer with a 2xx status within 10 seconds. Redirects are not followed and count as failures.
  • Each alert is sent once. There are no retries, so answer immediately and do slow work afterwards.

Securing your endpoint

Requests are not signed. Put a long random secret in the URL path, such as https://hooks.example.com/fastping/8f3c2a1e9b7d4c6a, accept requests only on that exact path and keep the URL private. Treat the content as untrusted input: monitor names and details are text your team typed or that monitored servers returned.

Receiver example

JavaScript
// receiver.mjs: node receiver.mjs (Node.js 18+, no dependencies)
import http from 'node:http';

const SECRET_PATH = '/fastping/8f3c2a1e9b7d4c6a'; // long random path segment, keep it private

http.createServer((req, res) => {
  if (req.method !== 'POST' || req.url !== SECRET_PATH) { res.writeHead(404).end(); return; }
  let body = '';
  req.on('data', (chunk) => { body += chunk; if (body.length > 65536) req.destroy(); });
  req.on('end', () => {
    res.writeHead(204).end(); // answer first: FastPing waits at most 10 seconds
    try {
      const alert = JSON.parse(body);
      console.log(alert.event, alert.monitor.name, alert.detail);
      // ...open a ticket, page someone, restart a service...
    } catch { /* not JSON: ignore */ }
  });
}).listen(8080);

Ainda precisa de ajuda?

Escreva para nós e uma pessoa vai responder, normalmente em até um dia útil.