link.delete webhook event

Flyn sends link.delete to your webhook URL when a link is deleted with DELETE /api/links/:id or in the Flyn dashboard. The delivery carries the full link object as it was just before it was deleted.

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.delete fires

  • DELETE /api/links/:id deletes a link. The flyn-sdk package and the MCP server's delete_link tool use the same endpoint.
  • Someone deletes one link or several links in the Flyn dashboard. Each deleted link sends its own event.

It does not fire when:

  • A link is archived with PATCH /api/links/:id. That is a status change and sends link.update.
  • A link reaches its expiry date. It stops redirecting but is not deleted, and Flyn has no expiry event.
  • Links are removed because a whole account was deleted.

Who receives it

The webhooks of the user who deleted the link. If a workspace owner or admin deletes a teammate's link, their own webhooks receive the event, not the link creator's. Only webhooks that are active and subscribed to link.delete receive it.

Payload

data is the full link object as it was just before deletion, whether the delete came from the API or the dashboard. The API call itself answers {"deleted": true, "id": "..."}.

link.delete
{
  "event": "link.delete",
  "timestamp": 1790164800000,
  "data": {
    "id": "3f0c2a9e-7b1d-4c55-9a0e-2d8f1b6c4e11",
    "slug": "summer-sale",
    "url": "https://shop.example.com/sale-v2",
    "shortUrl": "https://flyn.co/summer-sale",
    "domain": "flyn.co",
    "title": "Summer sale",
    "clicks": 42,
    "botClicks": 3,
    "qrScans": 5,
    "totalClicks": 45,
    "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.

Deleting a link also deletes its click events. If you need the numbers later, store clicks, botClicks, qrScans and totalClicks from this payload.

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.delete".
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, compare the ids you hold with GET /api/links. A link that is no longer listed, and answers 404 on GET /api/links/:id, is gone.

Common questions

Can I get a deleted link back from the API?

No. After a delete, GET /api/links/:id answers 404 and the link's click events are gone. The link.delete payload is the last copy Flyn sends.

Is there a link.expired event?

No. Flyn sends four link events: link.click, link.create, link.update and link.delete. A link that reaches its expiry date stops redirecting and sends nothing.

Does Flyn retry a failed link.delete delivery?

No. Flyn sends each link.delete once, with a 10 second timeout, and does not send it again. To catch up, compare the ids you hold 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.
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. This page.
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?