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/links creates a link. The flyn-sdk package and the MCP server's create_short_link tool 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.

link.create (API)
{
  "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:

FieldTypeDescription
eventstringThe event name, the same value as the X-Flyn-Event header.
timestampnumberUnix time in milliseconds when Flyn built the delivery. The same value as t in the X-Flyn-Signature header.
dataobjectThe event data. Its shape depends on the event.
data.idstringThe link id (UUID).
data.slugstringThe short link slug.
data.urlstringThe destination URL.
data.shortUrlstringThe full short URL: https://, the link domain, a slash and the slug.
data.domainstringThe domain the link is on: Flyn's short domain or your custom domain.
data.titlestring | nullThe link title. POST /api/links uses the destination hostname when you send none.
data.clicksnumberHuman clicks. Hits that Flyn filters out as bots or crawlers are not counted here.
data.botClicksnumberHits filtered out as bots or crawlers.
data.qrScansnumberHuman clicks that came from a Flyn QR code. Already included in clicks.
data.totalClicksnumberclicks plus botClicks.
data.statusstring"active", "expired" or "archived".
data.tagsstring[]The tags on the link.
data.createdAtstringWhen the link was created, as an ISO 8601 timestamp.
data.expiresAtstring | nullWhen the link expires, or null.
data.folderIdstring | nullThe folder id, or null.
data.passwordbooleantrue when the link has a password. The password itself is never sent.
data.ogTitlestring | nullCustom link preview title, or null.
data.ogDescriptionstring | nullCustom link preview description, or null.
data.ogImagestring | nullCustom link preview image URL, or null.
data.targetingobject | nullDevice and country rules, or null when the link has none.
data.cloakingbooleanWhether link cloaking is on.
data.noIndexbooleanA stored legacy flag with no effect on how the link is served.
data.notesstring | nullPrivate notes, or null.
data.abUrlBstring | nullThe legacy A/B variant URL, or null.
data.abSplitnumber | nullThe legacy A/B split: the percent of traffic sent to url. The rest goes to abUrlB.
data.rotationobject[] | nullThe weighted rotation destinations (id, url, weight, label), or null.
data.deepLinkbooleanWhether deep linking (open in the native app) is on.
data.pixelIdsstring[]The ids of the retargeting pixels attached to the link.
data.forwardParamsbooleanWhether query parameters a visitor adds to the short link are passed on to the destination.
data.clickLimitnumber | nullThe cap on human clicks, or null.
data.fallbackUrlstring | nullWhere visitors go once the click limit is reached, or null.
data.conversionTrackingbooleanWhether conversion tracking is on.
data.conversionsnumberConversions recorded for the link.
data.conversionValueCentsnumberTotal conversion value, in cents.
data.conversionCurrencystring | nullThe 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.

link.create (dashboard)
{
  "event": "link.create",
  "timestamp": 1790157600000,
  "data": {
    "id": "3f0c2a9e-7b1d-4c55-9a0e-2d8f1b6c4e11",
    "slug": "summer-sale",
    "destinationUrl": "https://shop.example.com/sale",
    "domain": "flyn.co"
  }
}
FieldTypeDescription
data.idstringThe link id (UUID).
data.slugstringThe short link slug.
data.destinationUrlstringThe destination URL. Note the name: the API link object calls this field url.
data.domainstringThe 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:

FieldTypeDescription
Content-TypestringAlways "application/json".
X-Flyn-EventstringThe event name. For this event: "link.create".
X-Flyn-Signaturestringt=<Unix time in milliseconds>,v1=<hex HMAC-SHA256>. See Verify the signature.
User-AgentstringAlways "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.

Verify a delivery (Node.js)
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 check status with GET /api/webhooks as 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/:id and {"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.

EventSent when
link.clickA person opens one of your short links.
link.createA link is created with POST /api/links or in the dashboard. This page.
link.updateA link is changed with PATCH /api/links/:id or in the dashboard.
link.deleteA link is deleted with DELETE /api/links/:id or in the dashboard.
webhook.testYou 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?