Help centre

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

  1. Open the account menu and choose API & webhooks.
  2. In Webhook endpoints, enter your Webhook URL.
  3. Choose the events: All events, a single event, or completed + signed.
  4. Click + Add endpoint.
  5. Copy the signing secret (it starts whsec_). It is shown once.
If you lose the secret, delete the endpoint and add it again. A secret cannot be shown a second time.

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:

EventFires whenExtra data
envelope.sentthe envelope goes outnone
recipient.vieweda signer opens itrecipient
recipient.signeda signer signsrecipient
recipient.declineda signer declinesrecipient, reason
recipient.reassigneda signer hands it to someone elsefrom, to, reason
recipient.helper_addeda signer asks someone to approve or sign firstrecipient, requested_by, kind
recipient.helper_answeredthat person answersrecipient, requested_by, result
envelope.completedeveryone has signednone
envelope.voidedit is voidedreason
envelope.expiredit expires unsignednone
reminder.senta reminder goes outto (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.

Envelopes made with a test key fire webhooks exactly like live ones. See The sandbox.
Was this useful?