link.create webhook event
Flyn sends link.create to your webhook URL when a link is created with POST /api/links or in the Flyn dashboard. From the API, the delivery carries the full link object.
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.
When link.create fires
POST /api/linkscreates a link. The flyn-sdk package and the MCP server'screate_short_linktool use the same endpoint, so they fire it too.- Someone creates a single link in the Flyn dashboard.
It does not fire for:
POST /api/shorten, the endpoint these docs list as Quick Shorten. The dashboard's Quick Shorten, the Shorten button in the top bar, is a dashboard create: it does send link.create, with the four dashboard fields.POST /api/links/bulk-create(Create Many Links).- Links created by the importer (Import links on the Links page).
Who receives it
The webhooks of the user who created the link: the owner of the API key, or the person signed in to the dashboard. Only that user's own webhooks that are active and subscribed to link.create receive it.
Payload from the API
From POST /api/links, data is the full link object, the same one the API call returns.
{
"event": "link.create",
"timestamp": 1790157600000,
"data": {
"id": "3f0c2a9e-7b1d-4c55-9a0e-2d8f1b6c4e11",
"slug": "summer-sale",
"url": "https://shop.example.com/sale",
"shortUrl": "https://flyn.co/summer-sale",
"domain": "flyn.co",
"title": "shop.example.com",
"clicks": 0,
"botClicks": 0,
"qrScans": 0,
"totalClicks": 0,
"status": "active",
"tags": [
"q3"
],
"createdAt": "2026-09-23T10:00:00.123456+00:00",
"expiresAt": null,
"folderId": null,
"password": false,
"ogTitle": null,
"ogDescription": null,
"ogImage": null,
"targeting": null,
"cloaking": false,
"noIndex": false,
"notes": null,
"abUrlB": null,
"abSplit": null,
"rotation": null,
"deepLink": false,
"pixelIds": [],
"forwardParams": true,
"clickLimit": null,
"fallbackUrl": null,
"conversionTracking": false,
"conversions": 0,
"conversionValueCents": 0,
"conversionCurrency": null
}
}The data fields, in the order Flyn sends them:
| 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.id | string | The link id (UUID). |
| data.slug | string | The short link slug. |
| data.url | string | The destination URL. |
| data.shortUrl | string | The full short URL: https://, the link domain, a slash and the slug. |
| data.domain | string | The domain the link is on: Flyn's short domain or your custom domain. |
| data.title | string | null | The link title. POST /api/links uses the destination hostname when you send none. |
| data.clicks | number | Human clicks. Hits that Flyn filters out as bots or crawlers are not counted here. |
| data.botClicks | number | Hits filtered out as bots or crawlers. |
| data.qrScans | number | Human clicks that came from a Flyn QR code. Already included in clicks. |
| data.totalClicks | number | clicks plus botClicks. |
| data.status | string | "active", "expired" or "archived". |
| data.tags | string[] | The tags on the link. |
| data.createdAt | string | When the link was created, as an ISO 8601 timestamp. |
| data.expiresAt | string | null | When the link expires, or null. |
| data.folderId | string | null | The folder id, or null. |
| data.password | boolean | true when the link has a password. The password itself is never sent. |
| data.ogTitle | string | null | Custom link preview title, or null. |
| data.ogDescription | string | null | Custom link preview description, or null. |
| data.ogImage | string | null | Custom link preview image URL, or null. |
| data.targeting | object | null | Device and country rules, or null when the link has none. |
| data.cloaking | boolean | Whether link cloaking is on. |
| data.noIndex | boolean | A stored legacy flag with no effect on how the link is served. |
| data.notes | string | null | Private notes, or null. |
| data.abUrlB | string | null | The legacy A/B variant URL, or null. |
| data.abSplit | number | null | The legacy A/B split: the percent of traffic sent to url. The rest goes to abUrlB. |
| data.rotation | object[] | null | The weighted rotation destinations (id, url, weight, label), or null. |
| data.deepLink | boolean | Whether deep linking (open in the native app) is on. |
| data.pixelIds | string[] | The ids of the retargeting pixels attached to the link. |
| data.forwardParams | boolean | Whether query parameters a visitor adds to the short link are passed on to the destination. |
| data.clickLimit | number | null | The cap on human clicks, or null. |
| data.fallbackUrl | string | null | Where visitors go once the click limit is reached, or null. |
| data.conversionTracking | boolean | Whether conversion tracking is on. |
| data.conversions | number | Conversions recorded for the link. |
| data.conversionValueCents | number | Total conversion value, in cents. |
| data.conversionCurrency | string | null | The conversion currency, or null. |
Payload from the dashboard
For a link created in the dashboard, data has exactly four fields. Call GET /api/links/:id with the id when you need the full link object.
{
"event": "link.create",
"timestamp": 1790157600000,
"data": {
"id": "3f0c2a9e-7b1d-4c55-9a0e-2d8f1b6c4e11",
"slug": "summer-sale",
"destinationUrl": "https://shop.example.com/sale",
"domain": "flyn.co"
}
}| Field | Type | Description |
|---|---|---|
| data.id | string | The link id (UUID). |
| data.slug | string | The short link slug. |
| data.destinationUrl | string | The destination URL. Note the name: the API link object calls this field url. |
| data.domain | string | The domain the link is on. |
Events from the dashboard are limited to 30 a minute per IP address, so creating many links in quick succession there can skip some.
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: "link.create". |
| 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.
Delivery rules
- One attempt. Flyn sends each event once to every webhook that is active and subscribed to it. It does not retry.
- 10 second timeout for the whole request. Flyn follows up to 5 redirects inside that time.
- Success is any 2xx response. It resets the failure count to 0.
- Anything else is a failure and adds 1 to the failure count: a response outside 2xx, a timeout, a connection error, a redirect Flyn refuses to follow, or a URL that no longer resolves to a public address.
- 10 failures in a row switch the webhook off. Its status becomes
inactive, Flyn stops sending to it and emails the person who created it. That email can be skipped when several deliveries fail at the same moment, so checkstatuswithGET /api/webhooksas well. - Missed events are not sent again, and Flyn keeps no log of single deliveries. Settings, Webhooks shows the failures in a row and the time of the last successful delivery.
- Switch it back on with
PATCH /api/webhooks/:idand{"status": "active"}, or with Activate in Settings, Webhooks. Both reset the failure count. - To catch up after an outage, list your newest links with
GET /api/links?sort=created_at&order=desc, up to 100 a page.
Common questions
Does a bulk import or Create Many Links send link.create?
No. Links made by the importer, by POST /api/links/bulk-create or by POST /api/shorten send no link.create. To pick those links up, list them with GET /api/links.
Why does data have only four fields?
The link was created in the dashboard. A dashboard create sends id, slug, destinationUrl and domain. Call GET /api/links/:id with the id for the full link object.
Does Flyn retry a failed link.create delivery?
No. Flyn sends each link.create once, with a 10 second timeout, and does not send it again. To catch up, list your newest links with GET /api/links.
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. This page. |
| 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. |
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?