Skip to Content

Webhooks

Get a signed POST on your server when an envelope is sent, viewed, signed, declined, completed or voided, with retries for 3 days.

A webhook tells your server when something happens in your workspace, such as a client signing, so you don't have to poll. AppliFlo sends a POST with a small JSON summary to a URL you choose, signs it with a secret only you and AppliFlo know, and tries again for 3 days if your server doesn't answer.

Webhooks follow the Standard Webhooks spec, so any Standard Webhooks library can check them.

Summaries, never answers

A webhook says what happened and to which envelope: ids, names, statuses and times. It never carries what anyone typed into a form, signature images, access codes, IP addresses or files. To get the signed PDF, download it with the API.

Add an endpoint

Open Settings

An owner or admin opens Settings → API & AI apps on appliflo.com and scrolls to Webhooks. Webhooks work on every plan, and you don't need an API key to use them. A workspace can have up to 20 endpoints.

Add the URL and pick events

Click Add endpoint. Enter an https:// URL on the standard port (443), a name so you know what it is, and the events you want, or Select all.

Copy the signing secret

The secret starts with whsec_. It is shown once. Copy it into your server's settings, for example as APPLIFLO_WEBHOOK_SECRET. AppliFlo keeps it encrypted and can't show it again; if you lose it, rotate it.

Send a test

Open the endpoint's Delivery log and click Send test event. Your server gets a webhook.test event, and the log shows what your server answered.

Events

EventSent when
envelope.sentAn envelope is sent, or sent again with Resend. With signing in order, later people getting their turn is not a separate envelope.sent.
envelope.viewedA recipient's signing page first shows in their browser. Once per recipient per round, never after the round is over; a link scanner opening the link doesn't count. If the page never reports it (for example a signer working through the API), it comes when they consent.
envelope.signedOne recipient finished signing. Others may still have to.
envelope.declinedA recipient declined to sign.
envelope.completedEveryone has signed and the signed PDF is sealed and ready to download.
envelope.voidedThe sender voided the envelope.
bulk.row_failedOne row of a send to many batch could not be sent. Rows in a batch you cancelled are not announced.
document.detectedAppliFlo finished finding the boxes on an uploaded document.
webhook.testSomeone clicked Send test event. Only that endpoint gets it.

Every body has the same outer shape around the event's data:

{
  "id": "evt_k7q2m3x4b5n3p6r2t5v4w2y4",
  "type": "envelope.completed",
  "created_at": "2026-11-26T10:00:00Z",
  "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c",
  "data": { "...": "..." }
}

id is the event id. It is the same as the webhook-id header, and stays the same on every retry. Only event ids have a prefix (evt_); envelope, document, client and batch ids are plain strings such as cmwxfhd0u000qnzhjrb1yhjvw. Store all ids as text and don't parse them. Times are UTC to the second, such as 2026-11-26T10:00:00Z. New fields may be added to data, so ignore fields you don't know.

Envelope events

All six envelope.* events share one data shape:

FieldWhat it is
envelope_id, document_id, document_nameWhich envelope, and the document it carries.
statusawaiting, completing, completed, declined, expired or voided, as in Track envelopes.
round1 for the first send, then 2, 3 and on after each Resend.
sent_atWhen this round was sent. Always there.
completed_at, voided_atOnly once the envelope is completed or voided.
recipientOn envelope.viewed, envelope.signed and envelope.declined only: the person who acted, in the same shape as a recipients entry.
recipientsEveryone on the envelope.
client_idOnly when the envelope is linked to a client.

Each recipient has name, email, role, kind and status:

  • kind is signer, filler or cc.
  • role is the template role label, such as "Client", or null when the envelope was not sent from a template.
  • status is pending, sent, completed (signed) or declined. A cc stays pending.
  • viewed_at, signed_at and declined_at are there only once they happened. viewed_at is when the signing page first showed; the signing certificate keeps its own record.
{
  "id": "evt_a2b3c4d5e6f7g2h3j4k5m6n7",
  "type": "envelope.sent",
  "created_at": "2026-11-26T09:00:00Z",
  "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c",
  "data": {
    "envelope_id": "cmwxfhd0u000qnzhjrb1yhjvw",
    "document_id": "cmwxf9a2k0004qnzh8vd1m6pe",
    "document_name": "Tenancy agreement",
    "status": "awaiting",
    "round": 1,
    "sent_at": "2026-11-26T09:00:00Z",
    "recipients": [
      { "name": "Lan Nguyen", "email": "lan@example.com", "role": "Tenant", "kind": "signer", "status": "sent" },
      { "name": "Omar Haddad", "email": "omar@example.com", "role": "Landlord", "kind": "signer", "status": "sent" },
      { "name": "Priya Shah", "email": "priya@example.com", "role": null, "kind": "cc", "status": "pending" }
    ],
    "client_id": "cmwq3n7xb0002ld0k4h9s2e7f"
  }
}

Other events

row is the row's index in the batch you sent. error says in words why that row was not sent, such as a bounce. Fix it as in Send to many.

{
  "id": "evt_g2h3j4k5m6n7p2q3r4s5t6u7",
  "type": "bulk.row_failed",
  "created_at": "2026-11-26T09:03:41Z",
  "workspace_id": "cmw2k8r1d0000qnzh5t7b3a9c",
  "data": {
    "batch_id": "cmwy2c5ph0001qnzhd8k3w4ra",
    "row": 12,
    "error": "Bounced: mailbox full"
  }
}

Headers

HeaderValue
webhook-idThe event id: evt_ and 24 characters. The same on every retry of that event.
webhook-timestampWhen this attempt was sent, in Unix seconds.
webhook-signaturev1, and a base64 HMAC-SHA256 signature. During a secret rotation there are two, separated by a space.
content-typeapplication/json
user-agentAppliFlo-Webhooks/1

Check the signature

Check every request before you trust it. The signature is an HMAC-SHA256 of webhook-id, webhook-timestamp and the raw body, joined with dots:

{webhook-id}.{webhook-timestamp}.{raw body}

The key is the part of your secret after whsec_, base64-decoded. Compare signatures in constant time, and refuse a timestamp more than 5 minutes from your clock, so an old request can't be replayed.

Sign the raw body, exactly as it arrived. If your framework parses the JSON and you stringify it again, the bytes can change and the check fails.

The standardwebhooks package checks the signature and the timestamp for you.

npm install standardwebhooks
import express from "express";
import { Webhook } from "standardwebhooks";

const wh = new Webhook(process.env.APPLIFLO_WEBHOOK_SECRET); // whsec_...
const app = express();

// express.raw keeps the body as bytes, so the signature can be checked.
app.post("/hooks/appliflo", express.raw({ type: "application/json" }), (req, res) => {
  let event;
  try {
    event = wh.verify(req.body, req.headers);
  } catch {
    return res.status(400).send("Bad signature");
  }
  res.sendStatus(204); // answer first, then do the work
  handle(event);
});

Answer quickly

Answer with any 2xx status within 10 seconds. Anything else counts as a failure: another status, a timeout, or a redirect. AppliFlo doesn't follow redirects, so give the final URL. If the work takes longer, answer first and do it afterwards, for example from a queue.

Retries

Deliveries go out from a background job that runs about every 15 minutes. The first attempt lands within about 15 minutes of the event, not the instant it happens. A failed delivery is tried again after at least the wait below, counted from the attempt before, on the job's next run after that:

AttemptEarliest
1The next run, within about 15 minutes
21 minute later (in practice, the next run)
35 minutes later (in practice, the next run)
430 minutes later
52 hours later
65 hours later
710 hours later
8 and onEvery 12 hours

AppliFlo stops 3 days after the first attempt and marks that delivery as given up. A retry is the same event: same webhook-id, same body, a new webhook-timestamp and signature.

Retry in the delivery log and Send test event don't wait for the job: they try straight away.

Duplicates and order

  • Duplicates. The same event can reach you more than once, for example when your server did the work but answered too late. Keep the webhook-id of each event you have handled and skip one you have already seen.
  • Order is not guaranteed. Events can arrive out of order, especially after a retry. Don't assume envelope.signed arrives before envelope.completed. Use created_at and the status in data, or get the envelope for its current state before you act.

When an endpoint keeps failing

If every delivery to an endpoint fails for 3 days, AppliFlo turns the endpoint off and emails the workspace owners once. Settings shows it as disabled, with the reason.

You can also turn an endpoint off yourself. Deliveries already queued for it wait, and go out when you turn it back on; one whose event is more than 3 days old gives up after its next failed attempt. Events that happen while an endpoint is off are not queued for it. When your server is fixed, turn the endpoint back on in Settings, then list envelopes to catch up on what changed meanwhile.

Delivery log

Each endpoint's Delivery log shows every delivery from the last 30 days: the event, the time, your server's status code, the number of attempts, the request body as sent and the start of your server's reply. Bodies in the log are cut to about 4 KB. Filter by Failed to see what needs attention.

Rotate the secret

In the delivery log, click Rotate secret. The new secret is shown once, and starts with whsec_ like the first. The old one keeps signing alongside the new one for 24 hours: in that time every request carries two signatures, v1,<new> v1,<old>, so a server with either secret accepts it. Put the new secret on your server within the 24 hours. The verifiers above accept either signature, so there is nothing else to change.

Network and security

  • Endpoint URLs must use https:// on port 443. Other ports are refused.
  • AppliFlo won't send to private, loopback or link-local addresses, and doesn't follow redirects. It checks the URL when you save it and looks up your host's address again before every attempt, so a name that later points at a private address is refused too.
  • Requests don't come from fixed IP addresses, so don't rely on an IP allowlist. Check the signature instead.
  • Keep the secret on your server. Anyone with it can sign requests your server will accept. If it leaks, rotate it.

Test your endpoint

  1. Click Send test event in the endpoint's delivery log. AppliFlo sends a signed webhook.test event straight away.
  2. Check the log. A 2xx means your URL and your signature check both work.
  3. For real events, send yourself an envelope and sign it. You get envelope.sent, envelope.viewed, envelope.signed and envelope.completed.

To work on your own machine, expose your local server through an HTTPS tunnel and add the tunnel's URL as an endpoint. Remove the endpoint when you are done.

On this page