Webhooks allow your application to receive real-time notifications when events occur.
Our API sends an HTTP POST request to your configured endpoint whenever a subscribed event is triggered.
Currently, we support only envelope events. However, in the near future, we will support more.
First, you need to configure a webhook endpoint from the dashboard.
See below how a webhook configuration looks.
In this example, we demonstrate a webhook endpoint that listens to the envelope.expired event. However, you can specify more events and listen to multiple events in the same webhook endpoint.

⚠️ This example does not verify webhook signatures. For production use, see the signature verification section below.
We recommend testing your webhooks locally using the third-party tool ngrok.
First, copy the code snippet from the example above and run it. This will start your local server listening on port 3000.
Then, open a new terminal and start an ngrok tunnel with the following command:
https://e0c2-xxxx.ngrok-free.apphttps://e0c2-xxxx.ngrok-free.app/{your_slug}You should now start receiving webhook events on your local server.
Each webhook request includes an x-pdfgate-signature header.
Use this header to verify that the request was sent by PDFGate and that the payload was not modified in transit.
t: the Unix timestamp when the webhook was signedv1: one or more values that are HMAC-SHA256 signatures.x-pdfgate-signature: "t=1712345678,v1=abc123,v1=def456"To verify the webhook:
v1 signatures from the x-pdfgate-signature header{timestamp}.{raw_body} We may include multiple signatures during secret rotation. Your code should consider the webhook valid if any of the v1 signatures matches the expected value.
Each webhook delivers an Event type JSON payload:
Webhook deliveries may be retried and delivered out of order.
Before applying updates, we recommend retrieving the current state of the referenced resource from the API to ensure consistency.
If your endpoint does not return a 2xx status code, delivery is retried. Retries are scheduled relative to the original event time and processed by a background job every 3 minutes. After the final attempt, the webhook is marked as failed.
| Attempt | Delay |
|---|---|
| Attempt #1 | 5 minutes |
| Attempt #2 | 15 minutes |
| Attempt #3 | 1 hour |
| Attempt #4 | 6 hours |
| Attempt #5 | 24 hours |
| Attempt #6 | 48 hours |
If your signing secret is compromised, you can rotate it from the dashboard.
x-pdfgate-signature header will include multiple v1 values.