Penny Sign API
Send PDFs for e-signature from Penny CRM, place text and signature fields for each client, track every view and signature, and get back a completed PDF with a Certificate of Completion and tamper-evident audit trail.
- Base URL:
https://<your-penny-sign-host>/api/v1 - Format: JSON requests and responses; PDFs as base64 or multipart upload
- Coordinates: PDF points (1/72"), origin at the top-left of the page. A4 is 595 × 842, US Letter 612 × 792.
- Timestamps: ISO-8601 UTC in the API; the certificate renders them in the envelope's time zone (default
Pacific/Auckland).
Quick start
Create and send an envelope with one signer, two text fields, a signature and an auto-filled date:
curl -X POST https://sign.example.com/api/v1/envelopes \
-H "Authorization: Bearer $PENNY_SIGN_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Privacy Authority.pdf",
"message": "Hi Chenee, please review and sign. Thanks, Samuel",
"sender": { "name": "Samuel Adviser", "email": "samuel@yourfirm.co.nz",
"address": "5/36 Example Drive, Auckland 0632", "ip": "122.60.87.37" },
"external_ref": "deal_1042",
"documents": [{ "name": "Privacy Authority.pdf", "file_base64": "JVBERi0xLjcK..." }],
"recipients": [{ "id": "client", "name": "Chenee Cotton", "email": "chenee@example.com" }],
"fields": [
{ "type": "text", "recipient_id": "client", "page": 1, "x": 132, "y": 268, "width": 260, "height": 18, "label": "Full legal name" },
{ "type": "text", "recipient_id": "client", "page": 1, "x": 132, "y": 303, "width": 200, "height": 18, "label": "Mobile", "validation": "phone" },
{ "type": "signature", "recipient_id": "client", "page": 2, "x": 90, "y": 520 },
{ "type": "date_signed", "recipient_id": "client", "page": 2, "x": 330, "y": 535 }
],
"status": "sent"
}'
The client receives an email with a Review Document button. When everyone has signed you receive an envelope.completed webhook and can download the signed PDF from /envelopes/{id}/documents/combined.
Node.js example (multipart upload):
const form = new FormData();
form.append('documents', new Blob([fs.readFileSync('contract.pdf')], { type: 'application/pdf' }), 'contract.pdf');
form.append('payload', JSON.stringify({ subject: 'Credit Contract', recipients, fields, status: 'sent' }));
const res = await fetch(`${BASE}/api/v1/envelopes`, { method: 'POST', headers: { Authorization: `Bearer ${KEY}` }, body: form });
const envelope = await res.json();
Authentication
Every request needs an API key in the Authorization header. Keys start with psk_live_, belong to one account (one company / Penny CRM tenant) and are stored hashed — they cannot be retrieved again.
Authorization: Bearer psk_live_xxxxxxxxxxxxxxxxxxxxxxxx
Provision an account and key with npm run create-account -- --name "Company" --email ... or POST /admin/accounts with header X-Admin-Token (set ADMIN_TOKEN on the server). Keep keys server-side in Penny CRM — never in browser code.
Envelope lifecycle
| Status | Meaning |
|---|---|
created | Draft. Editable by deleting and recreating; send with POST /envelopes/{id}/send. |
sent | Envelope ID stamped on every page, documents hashed, first routing-order signers emailed. |
delivered | Every signer has opened and viewed the documents (“Certified Delivered”). |
completed | All signers finished. Final PDF + certificate generated and emailed to all parties. |
declined | A signer declined (reason recorded). Sender is emailed. |
voided | Sender cancelled via POST /envelopes/{id}/void. Signing links stop working. |
Recipients & routing
| Property | Description |
|---|---|
id | Your id for the recipient (e.g. "client", "partner"). Fields refer to it via recipient_id. |
name, email | Required. |
role | signer (default) or cc. CC recipients don't sign; they receive the completed copy. On completion every signer, every CC recipient and the sender are emailed the signed PDF + certificate as an attachment and a download link. |
routing_order | Signers with order 1 are emailed first; order 2 once all of order 1 have finished, and so on. Same number = parallel. |
access_code | Optional extra authentication. Share the code out-of-band (phone/SMS). Certificate shows Security Level: Email, Access Code Authentication. Locked for 15 minutes after 5 failed attempts. |
Fields
Each field belongs to one signer and is positioned on a page. Signers can only fill their own fields; other signers' completed text values are shown read-only.
| type | Signer action | Default size (pt) |
|---|---|---|
signature | Adopts a signature once (draw or choose a style), then one tap per signature field. Every signer needs at least one. | 150 × 42 |
initials | Adopted with the signature; one tap per field. | 56 × 32 |
text | Free text. Optional validation: email, number, phone, date; optional max_length. | 160 × 20 |
date | Text validated against the account date format (e.g. DD/MM/YYYY). | 100 × 20 |
checkbox | Tick box. Optional unless required: true (then it must be ticked). | 14 × 14 |
date_signed | Auto-filled with the signing date. | 100 × 20 |
full_name | Auto-filled with the signer's adopted name. | 160 × 20 |
email_address | Auto-filled with the signer's email. | 180 × 20 |
Common properties: id, recipient_id, document_index (default 0), page (1-based), x, y, width, height, required (default true), label (shown to the signer), placeholder, value (pre-fill from CRM), read_only, font_size (default 11), tab_order.
Fields outside the page bounds are rejected with 400 validation_error. Page sizes are returned in documents[].page_sizes.
Anchor placement
Instead of coordinates, put marker text in your Penny CRM document templates and let Penny Sign find it. Every occurrence gets a field; the marker text is whited-out on the sent document.
{ "type": "signature", "recipient_id": "client", "anchor": { "text": "/sig1/", "x_offset": 0, "y_offset": -26 } }
{ "type": "date_signed", "recipient_id": "client", "anchor": { "text": "/date1/" } }
If the text isn't found the request fails with anchor_not_found, unless ignore_if_missing: true. Anchor text must be real (selectable) PDF text, not part of a scanned image.
Signing experience
- Email — branded with your company colour; the Review Document button opens a secure, single-recipient link (valid 30 days by default).
- Access code (if set).
- Consent — the signer reads the sender's message and ticks I agree to use electronic records and signatures (with a link to the full Electronic Record and Signature Disclosure). Acceptance is recorded with timestamp, IP and an ERSD acceptance ID.
- Guided fields (AutoNav) — a Start → Next tag and a bottom navigation bar jump to each required field in reading order, with a live “2 of 5 required fields complete” progress bar. Pressing Enter in a text field moves to the next one. On phones, text fields open a large bottom-sheet input with a Next button so the keyboard never covers the document.
- Adopt signature — choose one of four handwriting styles or draw with finger/mouse; initials are adopted at the same time. Subsequent signature and initial fields are one tap.
- Finish — validates every required field, records the signature (IP, device, mobile/desktop, adoption method) and shows a confirmation. Signers can also Decline to sign with a reason and optionally withdraw ERSD consent.
Embedded signing
To let a client sign inside Penny CRM (e.g. in a meeting) request a short-lived link:
POST /api/v1/envelopes/{id}/recipients/client/signing-url
{ "return_url": "https://app.pennycrm.co.nz/deals/1042?signed=1", "ttl_minutes": 15 }
→ 201 { "url": "https://sign.example.com/sign/AbC...", "expires_in_minutes": 15 }
Open it in a new tab or iframe. After finishing or declining, the browser is redirected to return_url?event=signing_complete&envelope_id=... (or event=decline). Always confirm the outcome with the API or webhook rather than trusting the redirect alone.
Webhooks
Set webhook_url on the account (PATCH /account) or per envelope. Penny Sign POSTs JSON and retries failed deliveries at 10 s, 1 min, 5 min and 30 min.
| event | When |
|---|---|
envelope.sent | Envelope sent |
recipient.sent | Signing email sent to a recipient |
recipient.viewed | Recipient accepted the ERSD and opened the documents |
envelope.delivered | All signers have viewed |
recipient.completed | A signer finished. Includes field_values keyed by your field id — use this to write captured data back into Penny CRM. |
envelope.completed | All signers finished; includes final_sha256 and combined_pdf URL |
envelope.declined | A signer declined (reason included) |
envelope.voided | Sender voided the envelope |
POST {your webhook_url}
X-PennySign-Event: recipient.completed
X-PennySign-Signature: sha256=5d41402abc4b2a76b9719d911017c592...
{ "event": "recipient.completed", "occurred_at": "2026-11-22T06:38:35.000Z",
"envelope_id": "ED0C7A14-4AFE-83CD-810C-745C8E1E419D", "external_ref": "deal_1042",
"data": { "recipient_id": "...", "client_id": "client", "email": "chenee@example.com",
"signed_at": "...", "ip": "161.29.86.148", "signed_on_mobile": true,
"signature_adoption": "Drawn on Device", "field_values": { "mobile": "+64 21 555 0100" } } }
Verify the signature with your webhook secret (returned when the account is created; rotate with POST /account/webhook-secret):
const expected = 'sha256=' + crypto.createHmac('sha256', WEBHOOK_SECRET).update(rawBody).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.get('X-PennySign-Signature')));
Audit trail & Certificate of Completion
Every envelope has an append-only audit log. Each event stores timestamp, actor, email, IP address and user agent, and is hash-chained (SHA-256 of the previous hash + event), so any later edit or deletion is detectable. GET /envelopes/{id}/audit returns the events and an integrity check.
The Certificate of Completion appended to the signed PDF contains:
| Section | Contents |
|---|---|
| Certificate Of Completion | Envelope Id, Subject, Source Envelope, Document Pages, Certificate Pages, Signatures, Initials, AutoNav, EnvelopeId Stamping, Time Zone, Status, Envelope Originator (name, address, email, IP address) |
| Record Tracking | Status: Original, created timestamp, Holder (name + email), Location |
| Signer Events | Name, email, Security Level; signature image with “Signed by” stamp and signature ID; Signature Adoption (Drawn on Device / Pre-selected Style); Using IP Address; Signed using mobile; Sent / Viewed / Signed timestamps; Electronic Record and Signature Disclosure Accepted timestamp and ID |
| In Person Signer, Editor, Agent, Intermediary, Certified Delivery, Carbon Copy, Witness, Notary Events | Section headers always present; CC recipients listed with Sent timestamp |
| Envelope Summary Events | Envelope Sent (Hashed/Encrypted), Certified Delivered, Signing Complete, Completed (Security Checked) — plus Declined/Voided when applicable |
| Payment Events | Section header |
| Document Integrity | SHA-256 of each original upload and of the as-sent (Envelope ID stamped) version; audit hash-chain head |
| Audit Event Log | Every event with actor, timestamp and IP |
| Electronic Record and Signature Disclosure | Disclosure created-on date, parties agreed to, and the full disclosure text with your company name and contact email |
Documents are encrypted at rest with AES-256-GCM. Anyone can check a completed PDF against /verify/{envelopeId} (hash computed in their browser).
Downloading documents
GET /envelopes/{id}/documents/combined— signed documents + certificate (after completion)GET /envelopes/{id}/certificate— certificate only (works for in-progress envelopes too)GET /envelopes/{id}/documents/{documentId}— a single document as sent
Account settings
PATCH /account sets the company details used in emails, the signing page and the ERSD: name, address, email, ersd_contact_email, paper_copy_fee, timezone, date_format (DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD), brand_color, webhook_url, and optionally a fully custom ersd_text. Changing disclosure settings resets the ERSD “created on” date.
Sending email from your own domain (Google Workspace / Gmail)
By default emails come from the server address in MAIL_FROM. Each account can instead send from its own mailbox, e.g. sign@yourfirm.co.nz on Google Workspace:
- In the Google account for that mailbox, turn on 2-Step Verification, then create an App password (Google Account → Security → App passwords). If App passwords are hidden, a Workspace admin must allow them, or use Google's SMTP relay service instead.
- Save it — in the console's Email settings tab, or via the API:
PATCH /api/v1/account
{ "smtp": { "provider": "google", "user": "sign@yourfirm.co.nz", "pass": "abcdefghijklmnop",
"from": "Your Firm " } }
POST /api/v1/account/email-test { "to": "you@yourfirm.co.nz" }
Emails then show as “Samuel Adviser via Your Firm” <sign@yourfirm.co.nz>, appear in that mailbox's Sent folder, and replies go to the adviser who sent the envelope. The password is encrypted at rest and never returned by the API. Other providers: pass host, port, secure instead of provider. "smtp": null reverts to the server default. Google Workspace allows about 2,000 messages per user per day.
Errors
{ "error": { "code": "validation_error", "message": "fields[2] is outside page 1 (595x842pt)", "details": null } }
| HTTP | code |
|---|---|
| 400 | validation_error, anchor_not_found, invalid_json |
| 401 | unauthorized |
| 404 | not_found |
| 409 | invalid_state, not_completed |
| 413 | file_too_large (25 MB per PDF, 10 PDFs per envelope) |
Endpoint reference
| POST | /envelopes | Create (and optionally send) |
| GET | /envelopes | List (status, external_ref, updated_since, limit, offset) |
| GET | /envelopes/{id} | Status, recipients, field values |
| DELETE | /envelopes/{id} | Delete a draft |
| POST | /envelopes/{id}/send | Send a draft |
| POST | /envelopes/{id}/void | Void with reason |
| POST | /envelopes/{id}/remind | Re-email current signers |
| POST | /envelopes/{id}/recipients/{rid}/signing-url | Embedded signing link |
| GET | /envelopes/{id}/audit | Audit events + integrity |
| GET | /envelopes/{id}/certificate | Certificate PDF |
| GET | /envelopes/{id}/documents/combined | Signed PDF + certificate |
| GET | /envelopes/{id}/documents/{docId} | Single document |
| GET | /account | Account settings |
| PATCH | /account | Update settings |
| POST | /account/email-test | Test the saved email settings |
| POST | /account/webhook-secret | Rotate webhook secret |
| GET | /webhook-deliveries | Recent webhook attempts |
Full schemas: openapi.yaml (import into Postman, Insomnia or Swagger UI).
Penny CRM integration checklist
- Create one Penny Sign account per Penny CRM organisation; store its API key and webhook secret encrypted in the CRM.
- Set the account
webhook_urlto a CRM endpoint; verifyX-PennySign-Signatureon every request. - In the CRM “Send for signature” action, build the envelope from the deal/contact: recipients from contacts,
external_ref= deal id,sender= the logged-in adviser (include their IP for the certificate). - Use anchor tags (
/sig1/,/name1/…) in CRM document templates so field placement needs no coordinates. - On
recipient.completed, writefield_valuesback to the contact; onenvelope.completed, downloaddocuments/combinedand attach it to the deal. - Show envelope status in the CRM using
GET /envelopes?external_ref=deal_1042; offer Remind / Void / “Sign now” (embedded) buttons.