This page is for developers. To set up a webhook with Zapier, Make or Slack without code, see Automation with Zapier and Make.

Set up

Open Settings, go to the webhooks section, add an https address that is publicly reachable (localhost and private addresses are not allowed), choose the events and save. Signfinch shows a secret that starts with whsec_ once. Keep it. You can create a new secret later. Webhooks are available on the Pro and Business plans.

Events

  • envelope.sent: the request was sent to the recipients.
  • envelope.viewed: a recipient opened the document.
  • envelope.signed: a recipient signed.
  • envelope.declined: a recipient declined to sign.
  • envelope.completed: all recipients signed and the final document is ready.
  • envelope.voided: the request was cancelled.

The request

Signfinch sends a POST request with a JSON body. The body has the fields id, event, createdAt and data. The data object includes envelopeId, title, status, recipient and url, which links to the request in your account.

Headers:

  • x-webhook-event: the event name.
  • x-webhook-id: a unique delivery ID. Use it to avoid processing the same event twice.
  • x-webhook-signature: sha256= followed by the signature of the raw request body, made with your secret.

A request times out after 6 seconds, so answer quickly. Redirects are not followed: a redirect counts as a failed delivery, so use the final address. The settings show the last 100 deliveries with their status.

Check the signature

Compute the signature of the raw body with your secret and compare it with the header value after sha256=. Use a constant-time comparison. In Node.js you can use the built-in crypto module: build the expected value as "sha256=" plus the hex digest of an HMAC with SHA-256 over the raw body, then compare it to the header with timingSafeEqual.

Use the raw body exactly as received. If a framework parses the JSON first and you serialize it again, the signature will not match.

Slack and Discord

If the address is a Slack incoming webhook (hooks.slack.com) or a Discord webhook, Signfinch sends a ready text message with the event and the document title instead of JSON.