How to PDF Webhooks Guide

Webhooks let SublimePDF push notifications to your server when asynchronous events complete — a PDF finishes rendering, a batch job completes, or a conversion fails. Instead of polling the API for status, your application receives an HTTP POST callback the moment results are ready, enabling real-time workflows and reducing unnecessary API calls.

Follow the step-by-step instructions below, then use the free tool directly — no registration or download required.

Open Tool →

How to PDF Webhooks Guide — Step by Step

1

Create a webhook endpoint

Build an HTTP POST endpoint on your server (e.g., /webhooks/sublimepdf) that accepts JSON payloads. Return a 200 status quickly — process the payload asynchronously to avoid webhook timeouts.

2

Register the webhook in your dashboard

Go to Settings → Webhooks in the SublimePDF dashboard. Enter your endpoint URL, select which events to subscribe to (pdf.completed, pdf.failed, batch.completed), and save.

3

Verify webhook signatures

Each webhook request includes an X-Signature-256 header containing an HMAC-SHA256 hash of the request body using your webhook secret. Compute the hash on your end and compare to prevent accepting forged requests.

4

Parse the event payload

The JSON body contains: 'event' (event type), 'data' (event-specific payload with documentId, downloadUrl, metadata), and 'timestamp'. Use the documentId to match the webhook to the original generation request.

5

Implement retry handling

SublimePDF retries failed webhook deliveries (non-2xx responses) up to 5 times with exponential backoff over 24 hours. Make your endpoint idempotent — use the event's unique 'id' field to deduplicate in case of retries.

Pro Tips

  • 💡 Use a tool like ngrok or Cloudflare Tunnel during development to expose your local server to the internet for webhook testing.
  • 💡 Always verify the X-Signature-256 header in production — skipping signature verification opens your endpoint to spoofed webhook payloads.
  • 💡 Return a 200 response immediately, then process the webhook payload in a background job. If your endpoint takes too long, SublimePDF will treat it as a failure and retry.
  • 💡 Log every incoming webhook payload for debugging — store the raw JSON body along with headers so you can replay events if processing fails.

Privacy & Security

All processing happens directly in your browser. Your files are never uploaded to any server — they remain on your device throughout the entire process. SublimePDF uses WebAssembly technology for fast, secure, client-side processing.

Works Everywhere

This tool works on any modern browser — Chrome, Firefox, Safari, or Edge — on desktop, tablet, or mobile. No software to install. PDF is an open ISO standard supported by all major platforms.

How to PDF Webhooks Guide — FAQ

What events can I subscribe to?
Available events: pdf.completed (async PDF ready for download), pdf.failed (generation failed with error details), batch.completed (all items in a batch job are done), and template.updated (a saved template was modified).
How do I test webhooks during local development?
Use ngrok to create a public tunnel to your local server (ngrok http 3000), then register the ngrok URL as your webhook endpoint. The SublimePDF dashboard also has a 'Send Test Event' button that fires a sample payload.
What if my server is down when a webhook fires?
SublimePDF retries delivery up to 5 times with exponential backoff (1 min, 5 min, 30 min, 2 hours, 12 hours). If all retries fail, the event is logged in your dashboard under Webhooks → Failed Deliveries for manual inspection.
Can I have multiple webhook endpoints for different events?
Yes. Register separate endpoints for different event types, or register one endpoint for all events and route internally based on the 'event' field in the payload.

Ready to get started?

Use SublimePDF's free tools right now.

Open Tool