Penny Sign API v1

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

StatusMeaning
createdDraft. Editable by deleting and recreating; send with POST /envelopes/{id}/send.
sentEnvelope ID stamped on every page, documents hashed, first routing-order signers emailed.
deliveredEvery signer has opened and viewed the documents (“Certified Delivered”).
completedAll signers finished. Final PDF + certificate generated and emailed to all parties.
declinedA signer declined (reason recorded). Sender is emailed.
voidedSender cancelled via POST /envelopes/{id}/void. Signing links stop working.

Recipients & routing

PropertyDescription
idYour id for the recipient (e.g. "client", "partner"). Fields refer to it via recipient_id.
name, emailRequired.
rolesigner (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_orderSigners with order 1 are emailed first; order 2 once all of order 1 have finished, and so on. Same number = parallel.
access_codeOptional 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.

typeSigner actionDefault size (pt)
signatureAdopts a signature once (draw or choose a style), then one tap per signature field. Every signer needs at least one.150 × 42
initialsAdopted with the signature; one tap per field.56 × 32
textFree text. Optional validation: email, number, phone, date; optional max_length.160 × 20
dateText validated against the account date format (e.g. DD/MM/YYYY).100 × 20
checkboxTick box. Optional unless required: true (then it must be ticked).14 × 14
date_signedAuto-filled with the signing date.100 × 20
full_nameAuto-filled with the signer's adopted name.160 × 20
email_addressAuto-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

  1. Email — branded with your company colour; the Review Document button opens a secure, single-recipient link (valid 30 days by default).
  2. Access code (if set).
  3. 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.
  4. 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.
  5. 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.
  6. 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.

eventWhen
envelope.sentEnvelope sent
recipient.sentSigning email sent to a recipient
recipient.viewedRecipient accepted the ERSD and opened the documents
envelope.deliveredAll signers have viewed
recipient.completedA signer finished. Includes field_values keyed by your field id — use this to write captured data back into Penny CRM.
envelope.completedAll signers finished; includes final_sha256 and combined_pdf URL
envelope.declinedA signer declined (reason included)
envelope.voidedSender 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:

SectionContents
Certificate Of CompletionEnvelope Id, Subject, Source Envelope, Document Pages, Certificate Pages, Signatures, Initials, AutoNav, EnvelopeId Stamping, Time Zone, Status, Envelope Originator (name, address, email, IP address)
Record TrackingStatus: Original, created timestamp, Holder (name + email), Location
Signer EventsName, 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 EventsSection headers always present; CC recipients listed with Sent timestamp
Envelope Summary EventsEnvelope Sent (Hashed/Encrypted), Certified Delivered, Signing Complete, Completed (Security Checked) — plus Declined/Voided when applicable
Payment EventsSection header
Document IntegritySHA-256 of each original upload and of the as-sent (Envelope ID stamped) version; audit hash-chain head
Audit Event LogEvery event with actor, timestamp and IP
Electronic Record and Signature DisclosureDisclosure 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:

  1. 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.
  2. 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 } }
HTTPcode
400validation_error, anchor_not_found, invalid_json
401unauthorized
404not_found
409invalid_state, not_completed
413file_too_large (25 MB per PDF, 10 PDFs per envelope)

Endpoint reference

POST/envelopesCreate (and optionally send)
GET/envelopesList (status, external_ref, updated_since, limit, offset)
GET/envelopes/{id}Status, recipients, field values
DELETE/envelopes/{id}Delete a draft
POST/envelopes/{id}/sendSend a draft
POST/envelopes/{id}/voidVoid with reason
POST/envelopes/{id}/remindRe-email current signers
POST/envelopes/{id}/recipients/{rid}/signing-urlEmbedded signing link
GET/envelopes/{id}/auditAudit events + integrity
GET/envelopes/{id}/certificateCertificate PDF
GET/envelopes/{id}/documents/combinedSigned PDF + certificate
GET/envelopes/{id}/documents/{docId}Single document
GET/accountAccount settings
PATCH/accountUpdate settings
POST/account/email-testTest the saved email settings
POST/account/webhook-secretRotate webhook secret
GET/webhook-deliveriesRecent webhook attempts

Full schemas: openapi.yaml (import into Postman, Insomnia or Swagger UI).

Penny CRM integration checklist

  1. Create one Penny Sign account per Penny CRM organisation; store its API key and webhook secret encrypted in the CRM.
  2. Set the account webhook_url to a CRM endpoint; verify X-PennySign-Signature on every request.
  3. 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).
  4. Use anchor tags (/sig1/, /name1/…) in CRM document templates so field placement needs no coordinates.
  5. On recipient.completed, write field_values back to the contact; on envelope.completed, download documents/combined and attach it to the deal.
  6. Show envelope status in the CRM using GET /envelopes?external_ref=deal_1042; offer Remind / Void / “Sign now” (embedded) buttons.