Webhooks
Signed, retried callbacks for every envelope event: how to add an endpoint, verify the signature and handle retries.
Rather than polling, register an endpoint and SignSpry will POST to it each time something happens to one of your envelopes. Every delivery is signed so you can prove it came from us.
Add an endpoint
- Open the account menu and choose API & webhooks.
- In Webhook endpoints, enter your Webhook URL.
- Choose the events: All events, a single event, or completed + signed.
- Click + Add endpoint.
- Copy the signing secret (it starts
whsec_). It is shown once.
The URL must be a public http:// or https:// address with no username or password in it. Localhost, .local or .internal names and anything that resolves to a private address are refused, and the check is repeated at every delivery. Redirects are not followed. For local development, use a tunnel or a request-inspection service.
Beside each endpoint: Send test (a test.ping event), Pause / Resume, and Delete. The last eight deliveries show with their HTTP status, and a red "N consecutive failures" chip appears when deliveries keep failing.
What a delivery looks like
POST /your/endpoint
Content-Type: application/json
X-Signet-Event: envelope.completed
X-Signet-Signature: sha256=<hex digest>
{"id":"…","event":"envelope.completed","created_at":1787480000.1,
"data":{"envelope":{"id":"…","title":"…","status":"completed","recipients":[…]}}}
The header names begin X-Signet-; use that exact spelling. created_at is a Unix time in seconds. data.envelope is the same envelope object the API returns, and some events add fields:
| Event | Fires when | Extra data |
|---|---|---|
envelope.sent | the envelope goes out | none |
recipient.viewed | a signer opens it | recipient |
recipient.signed | a signer signs | recipient |
recipient.declined | a signer declines | recipient, reason |
recipient.reassigned | a signer hands it to someone else | from, to, reason |
recipient.helper_added | a signer asks someone to approve or sign first | recipient, requested_by, kind |
recipient.helper_answered | that person answers | recipient, requested_by, result |
envelope.completed | everyone has signed | none |
envelope.voided | it is voided | reason |
envelope.expired | it expires unsigned | none |
reminder.sent | a reminder goes out | to (and auto: true for automatic ones) |
An endpoint set to All events also receives recipient.skipped (a signer was skipped) and envelope.corrected (a sender corrected a sent envelope, with changes).
Verify the signature
X-Signet-Signature is sha256= followed by the HMAC-SHA256 of the raw request body, keyed with your endpoint secret. Compute it over the bytes you received, not over re-serialised JSON.
import hmac, hashlib
expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, request.headers["X-Signet-Signature"]):
abort(400)
Compare in constant time and verify before you act.
Retries
SignSpry waits up to 6 seconds for an answer. Any reply other than 2xx, a timeout, or a redirect counts as a failure, and the delivery is tried again: three attempts in all, a second or two apart. After that it is not sent again. Respond 200 quickly and do the work afterwards, because a slow endpoint looks like a failing one.
If your endpoint was down, read the envelope with the API to catch up; missed deliveries are not replayed.
Idempotency
Retries carry the same body and the same id. Record the ids you have handled and ignore repeats.