How Do I Add an eSignature to a PDF Using an API?
There are two approaches depending on whether you need to generate the PDF first or sign an existing one.
Approach 1: Generate the PDF and sign it in one workflow
This is the most efficient approach for teams that create documents from templates — contracts, offer letters, invoices, NDAs, and any document built from structured data.
eSignature API handles both steps in one platform:
- Create a document template in the drag-and-drop editor
- Call the API with your data to generate the PDF
- In the same call, specify recipients and signing fields
- The API generates the document, adds the fields, and sends it for signing
- When signing is complete, receive the signed PDF via webhook
This avoids the need for a separate PDF generation tool and a separate signing tool — one API call, one platform, one workflow.
Approach 2: Sign an existing PDF
If you already have a PDF — an uploaded contract, a scanned form, or a document created elsewhere:
- Upload your PDF as a template or pass the file directly to the API
- Define where signature fields, date fields, and text fields should appear using x/y coordinates or text tags
- Specify recipients and signing order
- Call the API to send for signing
- Receive the completed signed PDF via webhook
Basic API call example
curl -X POST https://api.craftmypdf.com/v1/create \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"template_id": "your_template_id",
"signers": [
{
"name": "Jane Smith",
"email": "jane@example.com",
"role": "signer"
}
]
}'
What happens after signing
- eSignature API sends a webhook POST to your configured URL
- The webhook payload includes document status, signer details, and a download URL
- Download the signed PDF — it includes an embedded audit trail with timestamps, IP addresses, and signing events
Field types you can place on a PDF
eSignature API supports ten field types: signature, initials, date signed, text, checkbox, dropdown, radio button, and more. Fields can be placed precisely using coordinate-based positioning or text tags embedded in the document template.
Add e-signatures to any PDF in minutes
Free plan. 50 documents per month. No credit card.