Apilyn DocsDeveloper portal

Outbound webhooks

Apilyn delivers versioned event envelopes to customer HTTPS endpoints with HMAC-SHA256 signatures. SSRF protections apply on create and on every delivery attempt.

Event envelope

{
  "id": "uuid",
  "type": "job.completed",
  "version": 1,
  "created_at": "2026-08-05T12:00:00Z",
  "data": { }
}

Headers

HeaderPurpose
X-Apilyn-Signaturet=<unix_seconds>,v1=<hex>
X-Apilyn-TimestampSame unix timestamp as t=
X-Apilyn-Event-IdEvent id (also in body)
X-Apilyn-Event-TypeEvent type (also in body)

Verify (Python)

import hashlib
import hmac
import time

def verify_apilyn_signature(*, secret: str, signature_header: str, raw_body: bytes, max_skew_seconds: int = 300) -> bool:
    # signature_header: "t=1710000000,v1=abcdef…"
    parts = dict(item.split("=", 1) for item in signature_header.split(","))
    timestamp = int(parts["t"])
    if abs(int(time.time()) - timestamp) > max_skew_seconds:
        return False
    signed = str(timestamp).encode("ascii") + b"." + raw_body
    digest = hmac.new(secret.encode("utf-8"), signed, hashlib.sha256).hexdigest()
    expected = f"t={timestamp},v1={digest}"
    return hmac.compare_digest(signature_header, expected)

Verify (TypeScript)

import crypto from "node:crypto";

export function verifyApilynSignature(opts: {
  secret: string;
  signatureHeader: string;
  rawBody: Buffer;
  maxSkewSeconds?: number;
}): boolean {
  const maxSkew = opts.maxSkewSeconds ?? 300;
  const parts = Object.fromEntries(
    opts.signatureHeader.split(",").map((item) => item.split("=") as [string, string]),
  );
  const timestamp = Number(parts.t);
  if (!Number.isFinite(timestamp)) return false;
  if (Math.abs(Math.floor(Date.now() / 1000) - timestamp) > maxSkew) return false;
  const signed = Buffer.concat([Buffer.from(`${timestamp}.`, "ascii"), opts.rawBody]);
  const digest = crypto.createHmac("sha256", opts.secret).update(signed).digest("hex");
  const expected = `t=${timestamp},v1=${digest}`;
  return crypto.timingSafeEqual(Buffer.from(opts.signatureHeader), Buffer.from(expected));
}

Implementation reference: backend/src/apilyn/webhooks/signing.py.

Management API

  • POST /v1/webhooks — create (returns one-time secret)
  • POST /v1/webhooks/{id}/rotate — rotate signing secret
  • GET /v1/webhooks/{id}/deliveries — inspect attempts
  • Replay creates a new delivery without mutating the source job

Private hostnames/IPs are rejected (blocked_hostname / blocked_ip).