Skip to main content

Retrieve signed documents

After an envelope is finalized, you can programmatically retrieve the signed documents and the audit trail. This is typically the final step in any integration — pulling the completed artefacts into your own systems for storage, compliance, or downstream processing.

info

Signed documents can be downloaded at any point after creation.

Audit log is available once the envelope is closed — status must be finalized, voided, or expired. Attempting to download it while the envelope is draft or sent will return an Envelope.NotFinalized error.


Check envelope status

Before attempting to download the audit log, confirm the envelope is in a closed status.

GET /api/v1/key/envelopes/{envelopeId}
X-Inspakt-Api-Key: <your-api-key>

Response

{
"success": true,
"payload": {
"envelope": {
"id": "env_01hx...",
"name": "Service Agreement — Acme Corp",
"status": "finalized",
"completedAt": "2025-04-01T14:32:00.000Z",
"createdAt": "2025-03-28T09:00:00.000Z"
}
}
}

Check that envelope.status is one of "finalized", "voided", or "expired" before attempting to download the audit log.


Download all documents as a ZIP

Returns a ZIP archive containing all documents in the envelope as signed PDFs, in a single request.

GET /api/v1/key/envelopes/{envelopeId}/pdf
X-Inspakt-Api-Key: <your-api-key>

Response

The response body is a binary ZIP file (application/zip). Save it directly to disk.

curl -X GET https://next.inspakt.com/api/v1/key/envelopes/env_01hx.../pdf \
-H "X-Inspakt-Api-Key: <key>" \
--output signed-documents.zip
tip

The ZIP will contain one PDF per document in the envelope, named according to the document's name field set at upload time.


Download a single document

If you need only a specific document from the envelope rather than the full ZIP, retrieve it individually.

First, get the document IDs by fetching the envelope with documents included:

GET /api/v1/key/envelopes/{envelopeId}?includeDocuments=true
X-Inspakt-Api-Key: <your-api-key>
{
"success": true,
"payload": {
"envelope": { ... },
"documents": [
{
"id": "doc_02jy...",
"name": "Service Agreement.pdf",
"order": 0,
"status": "completed"
}
]
}
}

Then download the specific document:

GET /api/v1/key/envelopes/{envelopeId}/documents/{documentId}/pdf
X-Inspakt-Api-Key: <your-api-key>

Response

Binary PDF file (application/pdf).

curl -X GET https://next.inspakt.com/api/v1/key/envelopes/env_01hx.../documents/doc_02jy.../pdf \
-H "X-Inspakt-Api-Key: <key>" \
--output agreement-signed.pdf

Download the audit log

The audit log is a tamper-evident PDF documenting every action taken on the envelope — who signed, when, from which IP address, and what biometric data was captured.

GET /api/v1/key/envelopes/{envelopeId}/audit/pdf
X-Inspakt-Api-Key: <your-api-key>

Response

Binary PDF file (application/pdf).

curl -X GET https://next.inspakt.com/api/v1/key/envelopes/env_01hx.../audit/pdf \
-H "X-Inspakt-Api-Key: <key>" \
--output audit-log.pdf

Possible errors

NameCause
Envelope.NotFoundThe envelopeId does not exist or does not belong to your team.
Envelope.NotFinalizedThe envelope has not reached finalized status yet.
Envelope.AuditNotFoundThe audit log could not be generated. Contact support if this persists.
caution

Store the audit log alongside the signed PDFs. The audit log is the legal proof of the signing process and is required for compliance in most jurisdictions.


The following pattern is suitable for event-driven integrations polling for completion:

# 1 — Poll until finalized (check every N minutes in production)
curl https://next.inspakt.com/api/v1/key/envelopes/env_01hx... \
-H "X-Inspakt-Api-Key: <key>"
# → check payload.envelope.status === "finalized"

# 2 — Download all signed documents
curl https://next.inspakt.com/api/v1/key/envelopes/env_01hx.../pdf \
-H "X-Inspakt-Api-Key: <key>" \
--output signed-documents.zip

# 3 — Download audit log
curl https://next.inspakt.com/api/v1/key/envelopes/env_01hx.../audit/pdf \
-H "X-Inspakt-Api-Key: <key>" \
--output audit-log.pdf