POST /api/webhooks

Get pushed the instant a PDF is ready

Subscribe to pdf.generated, pdf.downloaded, and pdf.expired — and we'll POST signed payloads to your URL with automatic retries (up to 2, after 60s and 5m).

Key points

1

No polling required

Notifications are sent as soon as the event happens, so latency is not bounded by a poll interval.

2

HMAC-signed payloads

Every request carries X-Webhook-Signature: sha256=<hex>. Verify with your webhook secret to reject forged calls.

3

Slack URLs auto-detected

Register a URL containing hooks.slack.com and we'll send a Block Kit message with a download button — no Slack-specific code on your side.

With this feature vs. without

Use webhooksPoll for status
Completion latencySent as soon as the event happensBounded by your poll interval
Server loadOne request per completionItems × poll count
Receiver setupPublic HTTPS endpoint requiredClient-only, no inbound endpoint
Slack deliveryJust register the URLBuild it yourself

How it looks in code

// Register a webhook endpoint
await fetch("/api/webhooks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://your-app.example.com/hooks/pdf",
    events: ["pdf.generated", "pdf.expired"],
  }),
});

// The response's data.secret is returned only on creation — store it.
// Verify the X-Webhook-Signature header on incoming requests:
//   sha256=HMAC_SHA256(payload, webhook_secret)
//
// 5xx, timeouts and connection errors are retried after 60s and 5m
// (3 attempts in total, including the first).
// Slack incoming-webhook URLs auto-receive Block Kit payloads.

Wire it into your workflow

Validate the integration on the Free plan, then scale up when you're ready.

Powered by FUNBREW PDF