All articles

eSignature Webhooks: Know When Every Party Has Signed

A webhook is a POST request GoodSign sends to your server when something happens to a document. Put a webhook URL in the send request and GoodSign posts document_complete as soon as the last party signs.

This guide covers the four events, the exact payload, a receiver in Node and PHP, how to check an event is genuine, what happens when your server is down, and how this differs from DocuSign Connect.

Should you use a webhook or poll the API?

Polling means calling GET /api/document/{uuid} on a timer until the status changes. It is fine for a handful of documents and needs no public endpoint.

A webhook is better when something should happen within seconds of signing, like filing the signed PDF. Use both: the webhook drives your app and a slow poll catches anything missed, because GoodSign does not retry.

How do I set up a webhook on GoodSign?

Add a webhook field to the send request. There is nothing to register in a dashboard and no account-wide setting. Each document carries its own URL.

curl --request POST \
  --url https://goodsign.io/api/usetemplate \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "uuid": "YOUR_TEMPLATE_UUID",
    "webhook": "https://example.com/hooks/goodsign?token=LONG_RANDOM_STRING",
    "metadata": {"customer_id": 4821},
    "signers": [
      {"key": "signer1", "name": "Jane Smith", "email": "jane@acme.com"}
    ]
  }'

The response echoes it back in doc.webhook. Three rules:

  • It must be a complete, valid URL. GoodSign skips an invalid one without telling you. The limit is 1,000 characters.
  • Set it when you send. The API has no call to change the URL on a document that is already out.
  • Let the URL carry context. Add your own record ID and a secret token to the query string. metadata also comes back in GET /api/document/{uuid}.

Which webhook events does GoodSign send?

Four events reach your URL:

Event When it is sent Worth knowing
signer_opened The signer's mail app loads the invitation or a reminder Sent on every load until that signer finishes, including automatic image loads.
signer_complete A signer finishes and others still have to sign Not sent for the last signer.
document_complete Everyone, including any witnesses, has signed Replaces signer_complete for the last signer.
signer_attachments_complete A signer has uploaded every required file, or their first file when none were required Once per signer.

Not posted to your webhook: the document being sent (the API response tells you), voids, bounced invitations, and a signer reporting the email as spam or wrongly addressed. A voided document shows "status": "voided" when you next fetch it, and each signer's emailStatus records how their invitation was delivered.

With embedded signing and email_external, GoodSign sends no invitation email, so signer_opened never fires.

What does the webhook payload look like?

Every event is a POST with Content-Type: application/json and a small body:

{"uuid": "1f0c9a52-7d1e-4b8a-9c3f-2e6d5a4b1c0f", "status": "signer_complete"}

uuid is the document. status holds the event name, not the document's status. There is no signer name, field data or PDF in the body. To see which signer finished, fetch the document and check each signer's complete flag.

document_complete and signer_attachments_complete add an attachments array when signers have uploaded files:

{
  "uuid": "1f0c9a52-7d1e-4b8a-9c3f-2e6d5a4b1c0f",
  "status": "document_complete",
  "attachments": [
    {"filename": "licence.jpg", "size": 284113, "mime": "image/jpeg",
     "label": "Driver licence", "signer": "jane@acme.com", "uploaded_at": 1763771400}
  ]
}

size is in bytes and uploaded_at is a Unix timestamp in seconds. Only files that passed GoodSign's upload checks are listed.

A minimal webhook receiver

In any language: check the token, answer 200 straight away, then fetch the document with your API key and act on what the API says.

Node.js (Express)

const express = require('express');
const app = express();
const API = 'https://goodsign.io/api';
const auth = { Authorization: `Bearer ${process.env.GOODSIGN_API_KEY}` };

app.post('/hooks/goodsign', express.json(), (req, res) => {
  const token = process.env.HOOK_TOKEN;   // refuse everything if it is not set
  if (!token || req.query.token !== token) return res.sendStatus(403);
  res.sendStatus(200);                    // answer first
  handle(req.body).catch(console.error);  // then do the work
});

async function handle({ uuid, status }) {
  const r = await fetch(`${API}/document/${uuid}`, { headers: auth });
  if (!r.ok) return;                      // not a document in your account
  const { master_doc } = await r.json();
  if (status === 'document_complete' && master_doc.status === 'complete') {
    await savePdf(uuid);
  }
}

async function savePdf(uuid, tries = 6) {
  const r = await fetch(`${API}/download/${uuid}`, { headers: auth });
  if (r.status === 404 && tries > 0) {    // PDF still rendering
    await new Promise((done) => setTimeout(done, 10000));
    return savePdf(uuid, tries - 1);
  }
  if (r.ok) store(uuid, Buffer.from(await r.arrayBuffer())); // your storage
}

app.listen(3000);

PHP

<?php
$token = (string) getenv('HOOK_TOKEN');
if ($token === '' || !hash_equals($token, (string) ($_GET['token'] ?? ''))) {
    http_response_code(403);
    exit;
}
$event = json_decode(file_get_contents('php://input'), true);
http_response_code(200);
if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();   // close the connection, keep running
}

$ch = curl_init('https://goodsign.io/api/document/' . rawurlencode($event['uuid'] ?? ''));
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('GOODSIGN_API_KEY')],
]);
$body = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200) exit; // not in your account
$doc = json_decode($body, true)['master_doc'];

if ($event['status'] === 'document_complete' && $doc['status'] === 'complete') {
    // queue a job that downloads /api/download/{uuid}, retrying on 404
}

The PDF retry matters. GoodSign renders the signed PDF in the background after the last signature, so it may not be ready when the webhook arrives. Until it is, GET /api/download/{uuid} returns 404 with the message Document is not complete.

How do I know a webhook really came from GoodSign?

GoodSign does not sign webhook requests. There is no signature header and no shared secret, so anyone who learns your URL could post a fake document_complete to it. Two habits close that gap:

  1. Put a secret in the URL. Add a long random token to the query string when you send, compare it in constant time on arrival, as the PHP example does, and use only https:// URLs.
  2. Treat the body as a hint. Call GET /api/document/{uuid} with your API key and act on the status that comes back. The lookup only finds documents in your own account, so a made-up uuid returns 404.

With both in place, a forged request can at most make you fetch a document you already own.

What happens if my endpoint is down?

GoodSign makes one POST per event. It does not read your response code and does not retry, so if your server is down or returns an error, that event is not sent again.

The same event can also arrive twice. signer_opened is sent each time a signing email loads, and document_complete can be sent again if a signer opens their link after the document is complete. Record each uuid and event you have handled, and skip repeats.

To catch anything you missed, run a reconciliation job. Once an hour, call POST /api/documents?status=complete (and ?status=voided if voids matter to you) and handle any uuid you have not already stored.

Coming from DocuSign Connect?

DocuSign's webhook service is called Connect. The differences that change your code:

DocuSign Connect GoodSign
Where you set it Account-wide, or per envelope with eventNotification Per document, with the webhook field
What the message carries Event data with envelope and recipient IDs, optionally an envelope summary and the PDFs The uuid, the event name and any uploaded file details
Proof of origin Optional HMAC signature None. Use a URL token and an API lookup
Failed deliveries Retried Not retried. Reconcile with a poll

Event names map like this:

  • envelope-completed becomes document_complete.
  • recipient-completed becomes signer_complete, except for the last signer.
  • recipient-delivered has no exact match. In DocuSign it means the recipient viewed the envelope. GoodSign's signer_opened means the invitation email was loaded.
  • envelope-sent, envelope-voided and envelope-declined have no GoodSign webhook.

GoodSign has no separate API plan: every account gets webhooks and the API at US$1.50 per document (NZ$/A$2.50 in New Zealand and Australia). The eSignature API pricing comparison sets that against DocuSign and Dropbox Sign.

Common questions

How do I get notified when all parties have finished signing? Set webhook on the send request and wait for document_complete. It is sent when every signer and witness has finished. Then download the PDF from GET /api/download/{uuid}.

Do webhooks cost extra? No. You pay US$1.50 for each document you send, and its events are included.

How do I test my receiver? Post the sample payload above to it with curl. A draft ("draft": true) is created without being sent, so it uses no credit, but nobody signs a draft, so no events fire. For an end-to-end test, send one real document to an address you control.

Start building

Create an account, add your first 10 credits at half price (US$7.50) and create an API key. The API docs build a ready-to-run send request for each of your templates, and the eSignature API page lists the main endpoints.

Need documents signed? Make a free electronic signature for your own PDFs, or send documents for signing at $1.50 each with no subscription.

Ready to simplify your document signing?

No subscription. Pay only when you send: $1.50 per envelope.

Try a Free Electronic Signature →

All rights reserved © GoodSign Limited 2026
2 Stuart St, Ponsonby, Auckland 1011, New Zealand...