Runnable, tested code for the SignatureAPI e-signature API. Send documents for signature, embed the signing ceremony in your app, verify webhooks, and download signed PDFs, in Node.js, Python, PHP, Ruby, Go, Java and C#.
Every folder is a small, self-contained project with a step-by-step README and its own tests. Offline tests run against a local mock API, so you can read and run the code before you have an API key. With a free test key, the live tests create real test-mode envelopes.
- Quick start
- Scripts: send, track, download
- Webhooks
- Tutorials: complete apps
- DOCX templates
- Use cases by industry
- No-code and low-code platforms
- API collections
- How the examples are tested
- Conventions
-
Sign up and copy your test API key from the dashboard. It starts with
key_test_. Test envelopes are free and have no legal effect. -
Send your first envelope with Node.js (no install needed):
git clone https://github.com/signatureapi/examples.git cd examples/scripts/node export SIGNATUREAPI_KEY=key_test_YOUR_KEY node send-envelope.mjs "Jane Doe" jane.doe@example.com
-
Open the envelope in the dashboard, preview the email, and sign as Jane. Then download the signed PDF:
node download-deliverable.mjs <envelope-id> signed.pdf
New to the API? Read the quickstart and the core concepts: an envelope holds documents and recipients, each recipient signs in a ceremony, and a completed envelope produces a deliverable with the signed documents and the audit log.
Dependency-free scripts that send a document for signature, check the status, and download the signed PDF. scripts/
| Language | Folder |
|---|---|
| Node.js | scripts/node (also bulk send from CSV) |
| Python | scripts/python (also bulk send from CSV) |
| PHP | scripts/php |
| Ruby | scripts/ruby |
| Go | scripts/go |
| Java | scripts/java |
| C# | scripts/csharp |
Bring your own file: scripts/upload-first uploads a local PDF or DOCX, then sends it.
SignatureAPI signs webhook deliveries with the Standard Webhooks scheme. Every example is checked against one shared test vector.
Verify a signature with the standard library only: verify-webhooks/ in
Node.js, Python, PHP, Ruby, Go, Java and C#.
Receive webhooks in your framework, with raw-body verification, duplicate handling and event routing: webhooks/
| Framework | Folder |
|---|---|
| Express | webhooks/express |
| Next.js route handler | webhooks/nextjs |
| FastAPI | webhooks/fastapi |
| Django | webhooks/django |
| Laravel | webhooks/laravel |
| Ruby on Rails | webhooks/rails |
| Spring Boot | webhooks/spring |
| ASP.NET Core | webhooks/aspnet |
End-to-end apps that create an envelope on the server, embed the signing ceremony in the page, and track the result with verified webhooks. tutorials/
| Stack | Folder |
|---|---|
| Node.js (no dependencies) | tutorials/node |
| Python and Flask | tutorials/python-flask |
| Python and Django | tutorials/python-django |
| PHP and Laravel | tutorials/php-laravel |
| Ruby on Rails | tutorials/rails |
| Go (standard library) | tutorials/go |
| Java and Spring Boot | tutorials/java-spring |
| C# and ASP.NET Core | tutorials/dotnet |
Each app waits until the envelope is in_progress before it opens the ceremony, and streams the signed PDF through your server only once the deliverable is generated.
Twelve DOCX templates with merge fields and signature placeholders, written as fictional text for Acme Corp: offer letter, mutual NDA, employment contract, contractor agreement, master services agreement, statement of work with line items, residential lease, purchase agreement, medical consent, liability waiver, permission slip and change order. Each folder has the template, sample data and the envelope's recipients and places. One zero-dependency script uploads a template and sends it in test mode. Not legal advice. templates/
Nineteen runnable Node.js examples, each with a README that explains the business problem and why the envelope is shaped the way it is (routing, recipient types, places, authentication). use-cases/
| Use case | Shows |
|---|---|
| HR offer letters | DOCX template merge, approver then signer |
| Staffing onboarding | Bulk send from CSV, automatic countersignature |
| Real estate | Sequential routing with several signers |
| Property management leases | Parallel routing, initials |
| Lending | Preparer, captured inputs |
| Healthcare consent | Two-step authentication, no health data in metadata |
| SaaS order forms | Automatic countersignature, dropdown |
| Nonprofit volunteers | Parallel routing, branding |
| Agencies and SOWs | Several documents in one envelope |
| Insurance | Embedded ceremony |
| Education enrollment | Dropdown, radio group, validated inputs |
| Law firm engagement | Approver review, named deliverable |
| Construction change orders | Approver, prefilled text |
| Automotive | Auto-filled name, email and date places |
| Logistics drivers | Short signing URL for SMS |
| Marketplace providers | Embedded ceremony, redirect URL |
| Fintech account opening | Automatic countersignature, two-step authentication |
| Public sector | Official approver, the qualified signature path |
| Telecom | Embedded ceremony with email code |
Code and workflows that run inside automation platforms. Each folder's tests check them locally, without an account on the platform:
- Google Apps Script: one envelope per Google Sheets row, with each status refreshed by a time-driven trigger.
- Airtable: an automation script that creates an envelope per record, with the key in an Airtable secret.
- Pipedream: a Node.js code step that creates an envelope from a trigger event.
- n8n: seven importable workflows built from n8n's own HTTP Request node, including a verified
deliverable.generatedwebhook that downloads the signed PDF.
For other tools, use their generic HTTP request step with the same request body. Power Automate has an official connector.
Postman, Bruno, Insomnia and HTTPie collections generated from the OpenAPI spec, with a test-mode environment. collections/
bash .github/scripts/run-folder.sh <folder> runs one folder's tests exactly as CI does. Node.js and Python run on the host. PHP, Ruby, Go, Java and C# run in official Docker images pinned by digest, so you need only Docker installed.
The nightly workflow runs every folder. Offline tests always run. Live tests run in test mode when the SIGNATUREAPI_TEST_API_KEY secret is set and skip cleanly without it. A second job regenerates the collections from the published spec and fails when they drift.
- Test mode only. Every example reads the key from
SIGNATUREAPI_KEYand refuses keys that do not start withkey_test_. SetSIGNATUREAPI_BASE_URLto point at another environment. - Synthetic data. Names, emails and companies (Acme Corp, Jane Doe,
@example.com) are fictional. Sample documents are served fromhttps://pub-9cb75390636c4a8a83a6f76da33d7f45.r2.dev/docs-samples/. - Signed PDFs wait for the deliverable.
envelope.completedmeans everyone has signed. The signed PDF is ready later: download it ondeliverable.generated, or when the deliverable'sstatusisgenerated. - Envelope IDs are UUIDs, for example
eb4cf433-a8af-4161-b37b-7ef57d423e56. Other objects use prefixes:re_recipients,del_deliverables,evt_events,upl_uploads. - Never commit a key.
.envfiles are ignored by git.