webhook.test event (test ping)
Flyn sends webhook.test only when you ask for a test ping, with POST /api/webhooks/:id or the Send Test Ping button in Settings. It is signed like a real delivery, so you can check your endpoint and your signature code before real events arrive.
Plan needed
Creating a webhook needs Pro, Lifetime or Team. Pro is $12 a month, or $9 a month billed annually, and Lifetime is $249 once. Team means a teammate in a paying owner's workspace, with any role but viewer. On Free, POST /api/webhooks answers 403 with the code UPGRADE_REQUIRED. See pricing.
How to send a test ping
curl -X POST https://www.flyn.to/api/webhooks/WEBHOOK_ID \ -H "Authorization: Bearer $FLYN_API_KEY"
In the dashboard, open Settings, Webhooks, expand the webhook and click Send Test Ping. Only the person who created a webhook can ping it.
Payload
{
"event": "webhook.test",
"timestamp": 1790157600000,
"data": {
"message": "This is a test webhook from Flyn"
}
}| Field | Type | Description |
|---|---|---|
| event | string | The event name, the same value as the X-Flyn-Event header. |
| timestamp | number | Unix time in milliseconds when Flyn built the delivery. The same value as t in the X-Flyn-Signature header. |
| data | object | The event data. Its shape depends on the event. |
| data.message | string | Always "This is a test webhook from Flyn". |
What the ping call returns
The API call answers 200 and reports how your endpoint responded. When your endpoint answers with a 2xx:
{ "success": true, "status": 200 }When your endpoint answers with a status outside 2xx:
{ "success": false, "status": 500, "statusText": "Internal Server Error" }When the request times out after 10 seconds or fails on the network:
{ "success": false, "error": "Failed to send test ping" }Two errors come back with their own status: 404 Webhook not found when the id does not match a webhook you created, and 400 Webhook URL must be a public address when the webhook's URL does not resolve to a public address.
Rules
- You cannot subscribe to it.
webhook.testis not one of the eventsPOST /api/webhooksaccepts. It is sent only by the test ping. - It works on inactive webhooks, so you can check an endpoint before you switch a webhook back on.
- It is not counted. A test ping does not change
failureCountorlastTriggeredAt, whether it succeeds or fails. - Same signature, same headers, same 10 second timeout as a real delivery.
- 5 pings a minute per IP address. The 429 answer has no
Retry-Afterheader.
Headers
Every delivery is an HTTP POST with these four headers:
| Field | Type | Description |
|---|---|---|
| Content-Type | string | Always "application/json". |
| X-Flyn-Event | string | The event name. For this event: "webhook.test". |
| X-Flyn-Signature | string | t=<Unix time in milliseconds>,v1=<hex HMAC-SHA256>. See Verify the signature. |
| User-Agent | string | Always "Flyn-Webhook/1.0". |
Verify the signature
Flyn signs every delivery. v1 is the HMAC-SHA256, in hex, of the t value, a dot and the raw request body, keyed with your full webhook secret, including its whsec_ prefix. t is Unix time in milliseconds and equals timestamp in the body.
import { createHmac, timingSafeEqual } from 'node:crypto';
// rawBody: the request body exactly as it arrived (a Buffer or a string).
// header: the X-Flyn-Signature value, "t=<milliseconds>,v1=<hex>".
// secret: your full webhook secret, including the "whsec_" prefix.
export function isFromFlyn(rawBody, header, secret) {
const parts = Object.fromEntries((header || '').split(',').map((p) => p.trim().split('=')));
if (!/^\d+$/.test(parts.t || '') || !parts.v1) return false;
// t is Unix time in MILLISECONDS. Reject a delivery older than 5 minutes.
if (Math.abs(Date.now() - Number(parts.t)) > 5 * 60 * 1000) return false;
const expected = createHmac('sha256', secret).update(parts.t + '.').update(rawBody).digest();
const received = Buffer.from(parts.v1, 'hex');
return received.length === expected.length && timingSafeEqual(received, expected);
}Sign the raw body bytes, not a parsed and re-serialized copy. POST /api/webhooks returns the secret once, and the person who created the webhook can copy it in Settings, Webhooks. A complete Express handler is in the webhooks reference.
Common questions
How do I test a Flyn webhook?
Send a test ping: call POST /api/webhooks/:id with your API key, or click Send Test Ping in Settings, Webhooks. Flyn posts a signed webhook.test delivery to the webhook's URL and tells you the status your endpoint answered with.
Does a failed test ping count toward switching the webhook off?
No. A test ping never changes the failure count. Only real event deliveries are counted, and 10 failures in a row switch a webhook off.
Can I subscribe a webhook to webhook.test?
No. A webhook subscribes to link.click, link.create, link.update or link.delete. webhook.test is sent only when you ask for a ping.
All webhook events
Flyn sends five events. Each has its own page with the payload and the rules for when it fires.
| Event | Sent when |
|---|---|
| link.click | A person opens one of your short links. |
| link.create | A link is created with POST /api/links or in the dashboard. |
| link.update | A link is changed with PATCH /api/links/:id or in the dashboard. |
| link.delete | A link is deleted with DELETE /api/links/:id or in the dashboard. |
| webhook.test | You send a test ping. You cannot subscribe to it. This page. |
Start with the API quick start, or read the webhooks reference for the endpoints that create, list, update, test and delete webhooks.
Was this page helpful? Spotted something wrong?