Skip to main content

Webhooks

Webhooks send a signed HTTPS POST to your server when something happens in a project. Configure them in the console under Settings → Webhooks (project SETTINGS permission, EDIT level). They require the Outgoing webhooks right in your plan. The number of endpoints per organization is limited by the WEBHOOK_ENDPOINTS quota.

Events​

TypeSent when
link.createdA link is created (console, API, bulk import, distribution channel)
link.updatedA link is updated
link.deletedA link is deleted (data holds its last state)
link.clickedLinks of the project are clicked. Clicks are sent in batches of up to 100 per event, about 20 seconds after the clicks. See High-volume events
conversion.createdA lead or a sale is recorded by the server: POST /api/v1/track/lead and /track/sale, or the attribution API and the console (POST /api/v1/analytics/attribution/conversion). Sales declared by the web collection SDK never emit it
deeplink.installAn app install is matched to a click (deferred deep link): through the Play Install Referrer or the device match
feedback.createdA feedback item is published: on submission, or on approval when the board requires moderation. Items awaiting moderation are never sent
feedback.status_changedA feedback item's status changes (previousStatus, status)
feedback.vote_thresholdA feedback item reaches 10, 25, 50, 100, 250, 500 or 1,000 votes. Each threshold is sent once per item
pingYou click Test in the console. It is never retried

Request​

POST /your/endpoint HTTP/1.1
Content-Type: application/json
User-Agent: SLNK-Webhooks/1
X-Slnk-Event: link.created
X-Slnk-Delivery: 5b0c3f1e-8c1d-4b8e-9d0a-2f6a1c7e9b42
X-Slnk-Signature: t=1761386400,v1=5f2b...e91c
{
"id": "0b9d8c2a-6c49-4c5e-9a57-2a3f0f6f1d10",
"type": "link.created",
"createdAt": "2026-10-25T10:00:00Z",
"projectId": "PROJECT_ID",
"data": {
"id": "LINK_ID",
"shortCode": "Ab3dE9x",
"shortUrl": "https://slnk.ma/Ab3dE9x",
"originalUrl": "https://example.com/offer",
"title": "Autumn offer",
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2026-10-25T10:00:00Z",
"updatedAt": "2026-10-25T10:00:00Z"
}
}

Fields without a value are omitted, for example title, externalId, parentLinkId or expiresAt.

A feedback event's data contains id, boardId, title, type, status, voteCount, moderationStatus, createdAt, plus previousStatus (feedback.status_changed) or threshold (feedback.vote_threshold). Payloads never contain visitor IP addresses, IP hashes, device fingerprints, author names or e-mail addresses.

link.clicked​

{
"id": "4f1c2b7e-0d5a-4d7b-a6a1-5b2f8c3e9d01",
"type": "link.clicked",
"createdAt": "2026-11-06T09:30:21Z",
"projectId": "PROJECT_ID",
"data": {
"count": 2,
"clicks": [
{
"clickId": "8e3d4c1a-2b6f-3e9a-9c7d-1f0a2b3c4d5e",
"linkId": "LINK_ID",
"shortCode": "Ab3dE9x",
"clickedAt": "2026-11-06T09:30:02.114Z",
"entryType": "social",
"country": "Morocco",
"countryCode": "MA",
"region": "Casablanca-Settat",
"city": "Casablanca",
"deviceType": "mobile",
"os": "Android",
"browser": "Chrome Mobile",
"refererHost": "www.facebook.com",
"utmSource": "facebook",
"utmMedium": "social",
"utmCampaign": "autumn",
"platform": "ANDROID"
},
{
"clickId": "1a2b3c4d-5e6f-3a7b-8c9d-0e1f2a3b4c5d",
"linkId": "LINK_ID",
"shortCode": "Ab3dE9x",
"clickedAt": "2026-11-06T09:30:05.870Z",
"entryType": "qr_scan",
"country": "Morocco",
"countryCode": "MA",
"city": "Rabat",
"deviceType": "mobile",
"os": "iOS",
"browser": "Mobile Safari",
"platform": "IOS"
}
]
}
}
  • Clicks are ordered by clickedAt within an event. count is the number of clicks in the event (100 at most).
  • refererHost is only the host of the referring page, never its full URL. variantLabel is set for A/B variants and distribution channels.
  • linkId is missing when the link was deleted between the click and its processing.
  • The fraud score is computed after delivery and is not part of the payload. Use the analytics API to exclude suspect clicks.

conversion.created​

{
"conversionId": "CONVERSION_ID",
"kind": "SALE",
"eventName": "purchase",
"amount": 120.00,
"currency": "MAD",
"orderId": "R-1",
"status": "CONFIRMED",
"source": "API",
"convertedAt": "2026-11-06T09:42:00Z",
"click": { "id": "CLICK_ID", "linkId": "LINK_ID", "shortCode": "Ab3dE9x" },
"customer": { "id": "CUSTOMER_ID", "externalId": "CLI-000123" },
"lastTouch": { "linkId": "LINK_ID", "channel": "social", "campaignId": "CAMPAIGN_ID" },
"metadata": { "branch": "casa-anfa" }
}
  • kind is LEAD (account opening, sign-up; amount 0) or SALE. source is TRACK for /api/v1/track/*, API for the attribution API and the console.
  • click is the click declared with the conversion (clickId, the slnk_cid value); it is null when no click was declared.
  • customer is the customer of the conversion, null without customer. externalId is the customerExternalId of the request, sent back in clear so that your systems can match it; SLNK itself only stores it hashed. It is null when the request did not carry it.
  • lastTouch is the last touchpoint of the 30-day journey; it is omitted when the conversion has no touchpoint.
  • metadata is the free object sent to /track/*, relayed as is and never stored; it is omitted when absent. Do not put personal data in it.
  • A conversion sent again (same orderId, or same customer, or else click, and event for a lead) is a duplicate and emits nothing. The visitor identifier and the customer e-mail are never sent.
  • A subscription scoped to some links receives the conversions whose click, or else last touch, is one of its links.

deeplink.install​

{
"contextId": "CONTEXT_ID",
"linkId": "LINK_ID",
"shortCode": "Ab3dE9x",
"clickId": "CLICK_ID",
"appId": "APP_ID",
"platform": "ANDROID",
"matchMethod": "install_referrer",
"confidence": 0.95,
"deepLinkPath": "/products/42",
"campaignId": "CAMPAIGN_ID",
"matchedAt": "2026-11-06T09:45:13Z"
}

matchMethod is install_referrer (deterministic, Play Install Referrer) or fingerprint (probabilistic device match, confidence between 0 and 1). Each deferred context emits at most one event, even when the app calls the match twice. clickId is the click that created the context (null for a context stored before click ids); your back office can use it to declare leads and sales with /api/v1/track/*.

High-volume events (link.clicked)​

  • SLNK processes clicks every few seconds and groups the clicks of one processing batch into events of up to 100 clicks. Delivery follows within about 15 seconds, so expect about 20 seconds between a click and its webhook.
  • link.clicked events and their delivery log are kept for 7 days (30 days for the other types). Replay a failed delivery within that window.
  • Answer quickly: a busy project can produce several events per minute. Queue the work on your side and return 2xx at once.

A subscription receives the events of every link of the project by default. In the console you can limit it to up to 100 links (Scope → Selected links). A scoped subscription:

  • only receives link.*, conversion.created and deeplink.install events that carry one of its links. A link.clicked event then only contains the clicks of those links;
  • never receives an event without a link, such as a sale without click or touchpoint;
  • cannot subscribe to feedback.* events, which carry no link.

The endpoint resource (GET /api/v1/webhooks) exposes the scope in linkIds (absent for the whole project).

Respond, retries and disabling​

  • Answer with a 2xx status. Anything else is a failure: other status codes, redirects (3xx are never followed), and no answer within 3 s to connect or 10 s to respond (15 s in total).
  • Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h and 12 h, for 6 attempts in all.
  • The event id in the signed body is identical across retries and manual replays. Store it and ignore events you have already processed. X-Slnk-Delivery (also stable) identifies the delivery in the console log; it is not covered by the signature.
  • An endpoint whose deliveries have all failed for 24 hours triggers one email to the organization's owners and admins (once per failure series; a single success resets it).
  • An endpoint whose deliveries have all failed for 3 days is disabled automatically. Organization owners and admins get a notification and an email. After you fix the receiver, re-enable the endpoint and replay the interrupted deliveries from the delivery log. The log is kept for 30 days (7 days for link.clicked).
  • Alert emails show only the host of the endpoint URL, never its path or query, and go out in each admin's email language (French, English or Arabic, set in Settings > Profile).
  • Deliveries are not guaranteed to arrive in order. Use createdAt and the resource state, not arrival order.
  • Links removed by the automatic purge of expired links do not emit link.deleted.
  • SLNK only calls https URLs on port 443 or 8443 that resolve to public addresses. The address is checked again at every connection.
  • The delivery log keeps at most the first 1 KB of a text response (text, JSON, XML). Other bodies are not stored.
  • Test is limited to 5 requests per minute per endpoint.

Verify the signature​

X-Slnk-Signature is t=<unix seconds>,v1=<hex HMAC-SHA256>. The HMAC is computed with your endpoint secret (whsec_…, shown once at creation or rotation) over the string t + "." + raw body. To verify:

  1. Use the raw request body. A re-serialized JSON object does not match.
  2. Compare in constant time.
  3. Reject timestamps more than 5 minutes from your clock.

Regenerating the secret replaces it immediately.

Node.js​

import crypto from 'node:crypto'
import express from 'express'

export function verifySlnkSignature(rawBody, header, secret, toleranceSeconds = 300) {
const parts = (header ?? '').split(',').map((part) => part.trim().split('='))
const timestamp = parts.find(([key]) => key === 't')?.[1]
const signatures = parts.filter(([key]) => key === 'v1').map(([, value]) => value)
if (!timestamp || !/^\d{1,12}$/.test(timestamp) || signatures.length === 0) return false
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.`)
.update(rawBody)
.digest('hex')
const expectedBytes = Buffer.from(expected)
return signatures.some((signature) => {
const bytes = Buffer.from(signature)
return bytes.length === expectedBytes.length && crypto.timingSafeEqual(bytes, expectedBytes)
})
}

const app = express()
app.post('/slnk/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
if (!verifySlnkSignature(req.body, req.get('X-Slnk-Signature'), process.env.SLNK_WEBHOOK_SECRET)) {
return res.sendStatus(400)
}
const event = JSON.parse(req.body.toString('utf8'))
// Deduplicate on event.id, then queue the work and answer quickly.
res.sendStatus(204)
})

Java​

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.HexFormat;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public final class SlnkWebhooks {
public static boolean verify(byte[] rawBody, String header, String secret, long toleranceSeconds)
throws Exception {
if (header == null) return false;
String timestamp = null;
java.util.List<String> signatures = new java.util.ArrayList<>();
for (String part : header.split(",")) {
String[] kv = part.trim().split("=", 2);
if (kv.length != 2) continue;
if (kv[0].equals("t")) timestamp = kv[1];
if (kv[0].equals("v1")) signatures.add(kv[1]);
}
if (timestamp == null || !timestamp.matches("\\d{1,12}") || signatures.isEmpty()) return false;
long now = System.currentTimeMillis() / 1000;
if (Math.abs(now - Long.parseLong(timestamp)) > toleranceSeconds) return false;
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
mac.update((timestamp + ".").getBytes(StandardCharsets.UTF_8));
byte[] expected = HexFormat.of().formatHex(mac.doFinal(rawBody)).getBytes(StandardCharsets.US_ASCII);
for (String signature : signatures)
if (MessageDigest.isEqual(expected, signature.getBytes(StandardCharsets.US_ASCII))) return true;
return false;
}
}

Python​

import hashlib
import hmac
import time


def verify_slnk_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
parts = [part.strip().split("=", 1) for part in (header or "").split(",") if "=" in part]
timestamp = next((value for key, value in parts if key == "t"), None)
signatures = [value for key, value in parts if key == "v1"]
if not timestamp or not timestamp.isascii() or not timestamp.isdigit() or len(timestamp) > 12 or not signatures:
return False
if abs(time.time() - int(timestamp)) > tolerance:
return False
expected = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256).hexdigest().encode()
return any(hmac.compare_digest(expected, signature.encode()) for signature in signatures)

Test vector​

Secret whsec_test, timestamp 1760000000, body {"id":"evt","type":"link.created"}:

t=1760000000,v1=fdcfc3787a6dabc5735a7050693af165840df2f06a98b57e7b850ba527cc3bbd

The vector only checks the HMAC. Run it with a large tolerance, because this timestamp is in the past.