Integration patterns
Download Signed Documents
Download the signed PDF when its deliverable.generated webhook arrives, verify the request, and save the file to your own storage by deliverable ID.
After all recipients have signed, SignatureAPI generates a deliverable: the signed documents, by default with an audit log. This guide shows how to detect when a deliverable is ready, download the signed PDF, and save it to your own storage.
Overview
The flow has three parts:
- SignatureAPI sends a
deliverable.generatedwebhook event when the signed document is ready. The event includes a download URL. - Your server verifies the request, then downloads the PDF from the URL in the event.
- Your server saves the file to your storage and responds with
200 OK.
- SignatureAPI to Your webhook endpoint: Webhook
deliverable.generated - Your webhook endpoint: Verify the signature
- Your webhook endpoint to SignatureAPI: Download
GET data.url - SignatureAPI to Your webhook endpoint: The signed PDF
- Your webhook endpoint to Your storage: Save as
<deliverable id>.pdf - Your webhook endpoint to SignatureAPI: Respond
200 OK
- Webhook
deliverable.generatedThe event's
data.urlis a download link for the signed PDF, valid for one hour. - Verify the signature
Verify the raw body against the
webhook-*headers before trustingdata.url. - Save as
<deliverable id>.pdfName the file by
data.object_id(the deliverable ID): one envelope can have several deliverables. - Respond
200 OKAny status outside
2XXcounts as a failed delivery, and SignatureAPI sends the event again.
Dashed: a reply, or an asynchronous call such as a webhook.
Step 1: Set Up a Webhook
Register a webhook endpoint in the Dashboard and subscribe to the deliverable.generated event. See Set Up Webhooks for detailed instructions.
Step 2: Handle the Webhook Event
When the deliverable is generated, SignatureAPI sends an event with the download URL included directly in the payload:
{
"id": "evt_4GpGD1cNnrkemsTLAvPW9G",
"type": "deliverable.generated",
"timestamp": "2026-11-02T15:21:45.000Z",
"data": {
"object_id": "del_6FF89lKNyTNamOJCJd1tLL",
"object_type": "deliverable",
"envelope_id": "eb4cf433-a8af-4161-b37b-7ef57d423e56",
"envelope_metadata": {
"deal_id": "50055"
},
"deliverable_type": "standard",
"deliverable_name": null,
"included_documents": ["contract", "addendum"],
"url": "https://vault.signatureapi.com/envelopes/eb4cf433-a8af-4161-b37b-7ef57d423e56/deliverables/del_6FF89lKNyTNamOJCJd1tLL/sealed.pdf?Signature=..."
}
}Key properties in data:
url: A download link for the signed PDF. It expires after one hour.object_id: The deliverable ID. An envelope can have several deliverables, so use this ID, not the envelope ID, to name the file.deliverable_type: The type of deliverable (standardorsimple).deliverable_name: The custom name, if one was set when the deliverable was created.included_documents: The document keys included in this deliverable.envelope_metadata: The metadata you attached when creating the envelope.
Step 3: Download and Save the PDF
Verify the request first, against the raw body and the webhook-* headers, so a forged request can’t make your server download and store a file. Then download the PDF from data.url and save it, named by deliverable ID. This example uses Express and the Standard Webhooks library:
import express from "express";
import { Webhook } from "standardwebhooks";
const app = express();
const wh = new Webhook(process.env.SIGNATUREAPI_WEBHOOK_SECRET);
app.post("/webhooks/signatureapi", express.raw({ type: "application/json" }), async (req, res) => {
let event;
try {
// Verify the raw bytes; parse the JSON only after this succeeds
event = wh.verify(req.body.toString("utf8"), {
"webhook-id": req.header("webhook-id"),
"webhook-timestamp": req.header("webhook-timestamp"),
"webhook-signature": req.header("webhook-signature"),
});
} catch {
return res.status(400).send("Invalid signature");
}
if (event.type === "deliverable.generated") {
const pdfResponse = await fetch(event.data.url);
if (!pdfResponse.ok) return res.status(500).send("Download failed"); // SignatureAPI retries the event
const pdf = Buffer.from(await pdfResponse.arrayBuffer());
// One file per deliverable: an envelope can have several
await storage.save(`signed-documents/${event.data.envelope_id}/${event.data.object_id}.pdf`, pdf);
}
res.status(200).send("OK");
});storage.save stands for your own storage client, such as a cloud bucket or a file system. If the same event arrives twice, the second save overwrites the file with identical content.
The download URL in the event expires after one hour. If you need to download the file later, call the Retrieve Deliverable endpoint to get a fresh link.
Alternative: Retrieve the Deliverable via API
If you prefer to fetch deliverables without relying on the webhook URL, call the deliverables endpoint with the deliverable ID from the event:
GET /v1/deliverables/del_6FF89lKNyTNamOJCJd1tLL HTTP/1.1
Host: api.signatureapi.com
X-API-Key: YOUR_API_KEYThe response is the deliverable object, with a fresh url once its status is generated.
You can also list all deliverables for an envelope:
GET /v1/envelopes/eb4cf433-a8af-4161-b37b-7ef57d423e56/deliverables HTTP/1.1
Host: api.signatureapi.com
X-API-Key: YOUR_API_KEYKeep Learning
- Learn about deliverable types, including standard and simple formats.
- Set up webhooks to automate your document processing pipeline.
- Store envelope data alongside the signed document for a complete record.
- Protect deliverables with a password.