Quick start
Node: npm install ./snapsigner-sdk-node-1.1.0.tgz · Python: pip install ./snapsigner-1.1.0.tar.gz (or copy its snapsigner folder into your project and pip install cryptography)
import { SnapSigner } from '@snapsigner/sdk' import { readFile, writeFile } from 'node:fs/promises' const ss = new SnapSigner({ apiKey: process.env.SNAPSIGNER_KEY }) // 1. Encrypt locally and create one link per signer const doc = await ss.createDocument({ pdf: await readFile('lease.pdf'), title: 'Lease agreement', signers: [ { name: 'Dana Reyes', email: 'dana@example.com' }, { name: 'Lee Park', email: 'lee@example.com' }, ], inOrder: false, // true = Dana first, then Lee verify: { id: true }, // optional checks, billed per signer }) // Store doc.id and doc.key in your database. SnapSigner cannot recover the key. for (const link of doc.links) console.log(link.name, link.url) // send each link // 2. Later, when the "document.completed" webhook arrives const signedPdf = await ss.downloadSigned(doc.id, doc.key) await writeFile('lease-signed.pdf', signedPdf)
import os from snapsigner import SnapSigner ss = SnapSigner(os.environ['SNAPSIGNER_KEY']) # 1. Encrypt locally and create one link per signer doc = ss.create_document( open('lease.pdf', 'rb').read(), 'Lease agreement', [{'name': 'Dana Reyes', 'email': 'dana@example.com'}, {'name': 'Lee Park', 'email': 'lee@example.com'}], in_order=False, ) # Store doc['id'] and doc['key']. SnapSigner cannot recover the key. for link in doc['links']: print(link['name'], link['url']) # send each link # 2. Later, when the "document.completed" webhook arrives signed_pdf = ss.download_signed(doc['id'], doc['key']) open('lease-signed.pdf', 'wb').write(signed_pdf)
#k=…: browsers never send that part to a server, so SnapSigner never receives the key. Signers with an email address also confirm a 6-digit code before the document opens.doc.key with the document ID. Without it, nobody, including SnapSigner, can open the signed copy.Placing fields
By default each signer gets one signature field on the last page. To place fields yourself, pass fields. Positions are fractions of the page, measured from the top left; page: -1 means the document’s last page.
fields: [
{ type: 'signature', signer: 0, page: -1, x: 0.08, y: 0.80, w: 0.30, h: 0.06 },
{ type: 'date', signer: 0, page: -1, x: 0.42, y: 0.82, w: 0.18, h: 0.04 },
{ type: 'signature', signer: 1, page: -1, x: 0.56, y: 0.80, w: 0.30, h: 0.06 },
]
Test free, then pay only for what you send
| What | Price |
|---|---|
Test keys (ssk_test_…) | Free. Up to 100 documents a day, marked TEST and not legally binding, deleted after 7 days. Signer checks are free in test. Webhooks arrive with "livemode": false. |
Live API documents (ssk_live_…) | Included every month: 50 on Standard, 200 on Business Pro (10 on the free trial). Then $0.50 per document, from your prepaid balance or monthly invoice. Documents cancelled before anyone signs don’t count. |
| Go-live check | $1.00, given back as soon as your integration works. Your next 2 live documents are free while we check four things: a live key sends, your webhook answers 2xx, a document is signed, and the signed copy is downloaded. If something fails, the app tells you exactly how to fix it, and trying again is free. |
| Signer checks and payments | Same prices as in the app: ID $2.99, selfie $1.49, video $2.49 per signer (all three $4.99). Payment requests: 1% (at least $0.30). |
Verification API (Verifier plan, vfk_…) | $29 a month: 1,000 copy checks a month included, then $0.10 per check on your next invoice, plus 50 Certified Verification Reports a month. Send Authorization: Bearer vfk_… to POST /verify/<stamp>/check with the file’s sha384, or to POST /reports. Start it at snapsigner.com/check. |
| Certified Verification Report | $9.99 each without a plan: SnapSigner’s signed, timestamped proof of who signed, when, and whether a copy is the unaltered original. |
| Limits | 600 requests per 10 minutes per key · 10 keys · 10 webhook endpoints. Need more? Email hello@snapsigner.com for Enterprise pricing. |
Create test and live keys, see this month’s usage and run the go-live check in the app under Developers: API and webhooks.
REST reference
Base URL https://app.snapsigner.com/v1. Send Authorization: Bearer ssk_live_… (or ssk_test_… while you build) with every request. Responses to POST /docs include test, api_fee and golive_credit. The SDKs handle encryption; if you call the API directly, encrypt exactly as the SDK source shows.
| Method and path | What it does |
|---|---|
POST /docs | Create a document. Multipart fields: title, signers (JSON list of name and email), in_order (1 or 0), expires_days (1–365), fields_enc (encrypted layout), blob (encrypted PDF, up to 20 MB), checks (optional JSON list of id, selfie, video). Returns the ID and one token per signer. Signers are only asked for checks listed here, and these are billed: if your allowance, balance and pay as you go can’t cover them you get 402 with code checks_payment_required. |
GET /docs | Your 100 most recent documents with status, expiry and each signer’s status. |
GET /docs/{id}/file/signed | The latest signed copy, still encrypted. Decrypt it with your key. |
POST /docs/{id}/remind | Email a reminder to whoever still needs to sign. Never includes the link. |
POST /docs/{id}/void | Cancel a document. Every link stops working. |
POST /docs/{id}/delete | Delete the encrypted files. The stamp record stays for public verification. |
GET /checks | Signer-check prices, your monthly allowance left, prepaid balance and recent charges. Add balance in the app under Signer checks. |
GET /verify/{stamp_id} | Public: confirm a stamped document’s sender, signers, dates and hash. |
Limits: 600 requests per 10 minutes per key. Errors return JSON {"ok": false, "code": "…", "message": "…"} with a matching HTTP status.
Webhooks
Add an https endpoint in the app under Developers: API and webhooks. Each event is a JSON POST with status only: never document contents, links or keys.
| Event | When |
|---|---|
document.created | A document was sent. |
document.viewed | A signer opened their link. |
signer.verified | A signer confirmed their email code. |
signer.signed | One signer finished. |
document.completed | Everyone signed. Includes the Accepted or Rejected return check. |
document.voided · document.expired · document.deleted | The document was cancelled, timed out or removed. |
{
"id": "evt_3f9c…", "type": "document.completed", "created": 1792800000,
"data": { "document_id": "…", "title": "Lease agreement", "status": "signed",
"stamp_id": "SS-7K3Q-9A2B-XY4Z", "return_status": "accepted",
"signers_total": 2, "signers_signed": 2 }
}
Check the signature
Every request has X-SnapSigner-Signature: t=…,v1=…, an HMAC-SHA256 of "t." + raw body with your endpoint’s signing secret. Use the SDK helper with the raw, unparsed body:
// Node.js (Express) app.post('/snapsigner/webhook', express.raw({ type: 'application/json' }), (req, res) => { const event = verifyWebhook(req.body, req.get('X-SnapSigner-Signature'), process.env.SNAPSIGNER_WHSEC) if (event.type === 'document.completed') { /* download and store the signed PDF */ } res.sendStatus(200) }) # Python (Flask) event = verify_webhook(request.get_data(), request.headers['X-SnapSigner-Signature'], os.environ['SNAPSIGNER_WHSEC'])
Reply with any 2xx within 10 seconds. Failed deliveries are retried up to 4 times; an endpoint that fails 50 times in a row is switched off until you send a test from the app.