Getting Started with Digital Signatures
Learn how to send documents for signature by preparing your document, creating an envelope, and managing the signing workflow.
Overview
This guide walks through the basic digital signing flow. We will prepare a document with signing fields, create an envelope using the generated document, send the envelope to the recipient, and track live updates using webhooks.
At the moment, our digital signature API supports documents generated from HTML. Support for additional document preparation flows will be added later.
Prepare document for signing
The first step is to generate a PDF document that contains the fields needed for the signing process. For now, this document must be created from HTML using the HTML to PDF API.
In this example, we prepare a PDF with:
- A text field for the recipient name
- A signature field where the recipient will sign
- A date field with the
pdfgate-auto-fill="true"attribute, which is automatically populated by the server with the signing date and time.
You can generate the PDF by sending the HTML and enabling form fields:
Once the PDF is generated, keep the returned document ID. You will use it in the next step when creating the envelope.
Create an envelope
After generating the document, create an envelope using the document ID from the previous step as the value of sourceDocumentId field. The envelope can accept multiple document and recipients for signing, however, in this example we will keep it simple and add only one document and one recipient.
See the full API reference here: Create Envelope
Send envelope
Once the envelope is created, the next step is to send it. This will trigger the signing flow and deliver the signing request to the recipient’s email.
See the full API reference here: Send Envelope
After the envelope is sent, the recipient receives an email with a secure link to review and sign the document through the PDFGate signing interface.
Once the document is signed, the recipient receives a follow-up email that includes:
- The final signed document
- A detailed audit log with timestamps, IP address, and verification steps
You can view example outputs below:
Test Agreement
Test Agreement - Audit Log
Track live envelope updates using webhooks
To receive live updates about the signing flow, you can configure webhooks. This allows your application to react to important envelope events such as sending, or completion.
See the webhook documentation here: Webhooks documentation
Webhooks are the recommended way to keep your application in sync with envelope status changes in real time.