Webhooks Guide

Receive real-time events when links are clicked or modified

Webhooks allow your server to receive HTTP POST notifications from AWSYS.CO whenever specific events occur on your links. Use them to trigger workflows, update dashboards, or sync data to external systems in real time.

Create a Webhook

POST /api/v1/webhooks

Request body

{
  "url": "https://your-server.com/webhooks/awsys",
  "events": ["link.click", "link.created"],
  "secret": "your-signing-secret"
}
Field Type Required Description
url string Yes HTTPS endpoint that will receive POST requests
events string[] Yes List of event names to subscribe to (full names required — see table below)
secret string No Signing secret used to verify the X-Webhook-Signature header on each delivery

Supported Events

Use the full event name. Short names (e.g. click instead of link.click) return an INVALID_EVENTS error and the webhook will not be created.

Event Description
link.click A visitor was sent through the short link and the click was recorded, including a visitor who continues from the link preview page. One event per click.
link.created A new short link was created from the dashboard, with POST /api/v1/links or with POST /api/v1/bulk (one event per link). Returning an existing link for the same destination is not a creation.
link.updated A short link's destination or settings were changed from the dashboard or with PATCH.
link.deleted A short link was permanently deleted.
link.expired A visitor reached a link past its expiry date. Sent about once per link per hour rather than once per visitor, and it can repeat.
link.limit_reached A visitor reached a link that has used up its click limit. Sent about once per link per hour rather than once per visitor, and it can repeat.
link.geo_blocked A visitor was blocked by the link's geo-restriction rules. One event per blocked visit.

Not sent yet: changes made through MCP tools, imports and AWSYS.CO admin actions. link.click follows the clicks counted in your analytics, so a click that is not counted there, for example one answered by a traffic-routing rule, does not produce one.

Event Payload

AWSYS.CO delivers a JSON payload via HTTP POST to your endpoint. Every event has the same envelope; data describes the link. Here is an example for a link.click event:

{
  "event": "link.click",
  "timestamp": "2026-11-07T14:32:01.123Z",
  "data": {
    "short": "t3hf-abc123",
    "fullUrl": "https://awsys.co/t3hf/abc123",
    "destination": "https://example.com/landing-page",
    "clickNumber": 42,
    "visitor": {
      "country": "US",
      "city": "Austin",
      "browser": "Chrome",
      "os": "macOS 14.1",
      "device": "Desktop"
    }
  }
}
Field in data Events Description
short all The link's identifier, accepted by GET /api/v1/links/{short}. prefix-code for namespaced links, the plain code for older links.
fullUrl all The public short URL.
destination all Where the link points. For link.updated this is the new destination.
clickNumber link.click The number of this click on the link.
visitor link.click, link.geo_blocked country (two-letter code or Unknown); link.click adds city, browser, os and device. The visitor's IP address is never sent.
updated link.updated Names of the fields that changed. Values are not sent.
expiresAt link.expired The link's expiry time, ISO 8601.
maxClicks, clicks link.limit_reached The link's click limit and the clicks recorded so far.

Signature Verification

Every delivery includes an X-Webhook-Signature header containing the hex HMAC-SHA256 of the JSON request body, computed with your webhook secret, and an X-Webhook-Event header with the event name. Always verify the signature before processing the payload.

const crypto = require('crypto');

function verifySignature(rawBody, secret, signatureHeader) {
  const sig = crypto
    .createHmac('sha256', secret)
    .update(rawBody)
    .digest('hex');
  if (sig !== signatureHeader) {
    throw new Error('Invalid signature');
  }
}

// Express.js example
app.post('/webhooks/awsys', express.raw({ type: 'application/json' }), (req, res) => {
  verifySignature(
    req.body,
    process.env.WEBHOOK_SECRET,
    req.headers['x-webhook-signature']
  );
  const event = JSON.parse(req.body);
  // handle event...
  res.sendStatus(200);
});

Use express.raw(), not express.json(), when receiving webhook payloads. The HMAC signature is computed over the raw bytes — parsing to JSON first changes the byte representation and will cause verification to fail.

Delivery and Failures

AWSYS.CO sends each event once to every enabled webhook subscribed to it, with Content-Type: application/json and User-Agent: awsys.co-webhook/1.0.

  • Answer fast. Deliveries are sent while the request that caused the event is still open, a visitor's redirect or your own API call. AWSYS.CO waits at most 1 second for your endpoint and then carries on. Reply with a 2xx straight away and do the real work afterwards. A slower delivery is not cancelled, but it may arrive late or, rarely, be lost.
  • No automatic retries. A delivery fails on a non-2xx status, a connection error, or no answer within 5 seconds. A failed delivery is not sent again.
  • Webhooks that keep failing are disabled. After 10 failed deliveries in a row the webhook is disabled and shows as Disabled in Settings → Webhooks; any successful delivery before that resets the count. A disabled webhook does not resume by itself: create a new webhook instead (delete the disabled one first if you are at your plan's webhook limit).
  • Changes apply within about 30 seconds. A webhook you create, edit or delete may keep its old behavior for that long.

Events are not ordered and can be repeated, so make your endpoint idempotent and key on data.short and timestamp.

curl example — create a webhook

curl -X POST https://awsys.co/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/awsys",
    "events": ["link.click", "link.created", "link.deleted"],
    "secret": "your-signing-secret"
  }'