record.completed webhook event
Esign Comply sends the record.completed webhook event when a record is durably written and its receipt is signed. It is sent in test mode and in live mode. The delivery is a signed POST to every enabled endpoint that subscribes to the type or to all events.
Event type record.completed · API version 2026-11-21
When record.completed fires
Sent when a record has been written and its receipt has been signed. Two calls make a record: POST /v1/sessions/{id}/complete and POST /v1/records/deferred. The event is queued in the same transaction that attaches the receipt, so it is never sent for a record that has no receipt.
When the receipt cannot be signed during the request, the call answers with status: "pending_seal" and the receipt is signed in the background. The event follows when that signing succeeds.
A receipt is attached to a record once, so the event is sent once per record. A live record that was sealed with a failed Block rule also sends conformance.finding_reported, which is queued first. record.timestamped is queued separately. Delivery order between these events is not guaranteed.
Example delivery
This delivery was captured from a local server on November 26, 2026. IDs are example values, and long values are shortened with ....
POST /webhooks/esigncomply
webhook-id: whe_8Rt4
webhook-timestamp: 1795652175
webhook-signature: v1,r9OOpC9Hk3d6RQIckZVzeHf0LpkZWRpxppe34s11POo=
content-type: application/json
user-agent: EsignComply-Webhooks/1.0
{
"id": "whe_8Rt4",
"data": {
"status": "recorded",
"purpose": "account_signup",
"documents": [
{
"version_id": "dv_3kT9",
"content_hash": "sha256:4e712fcc..."
},
{
"version_id": "dv_Lm02",
"content_hash": "sha256:8499061f..."
}
],
"record_id": "rec_Z4m8",
"signed_at": "2026-11-26T00:16:14.024Z",
"session_id": "ses_5nWq",
"record_hash": "sha256:24ccd731...",
"assurance_level": "L1",
"signature_level": "simple",
"signer_external_id": "user_7c1d"
},
"type": "record.completed",
"object": "event",
"livemode": false,
"created_at": "2026-11-26T00:16:15.259Z",
"api_version": "2026-11-21"
}
Fields
The body of every delivery has the same seven fields:
| Field | Type | Description |
|---|---|---|
object |
string | Always event. |
id |
string | The event ID, whe_ and 20 characters. The same value as the webhook-id header, and the same on every retry. |
type |
string | The event type. |
api_version |
string | The API version the endpoint was created on. |
livemode |
boolean | true for an event of live mode. A live event goes to live endpoints only, and a test event to test endpoints only. |
created_at |
datetime | When Esign Comply queued the event for delivery. |
data |
object | The fields of the event, listed below. |
Fields of data
| Field | Type | Description |
|---|---|---|
record_id |
string | The record. |
session_id |
string or null | The session that produced the record. null for a record made with POST /v1/records/deferred. |
signer_external_id |
string | The signer, as your application named them. |
status |
string | Always recorded. |
record_hash |
string | The hash of the record: sha256: followed by 64 hexadecimal characters. |
signed_at |
datetime | The server time of the signing act. For a deferred record: the time Esign Comply received your report. |
assurance_level |
string | L1, L2 or L3. Always L1 for a deferred record. |
signature_level |
string | simple or not_applicable. |
documents |
object[] | One entry for each document version in the record. |
documents[].version_id |
string | The document version the signer accepted. |
documents[].content_hash |
string | The content hash of that version. |
purpose |
string or null | The purpose of the session: its context.purpose, or the profile's purpose when the session set none. null when neither is set, and for a deferred record. |
Verify the signature
Every delivery carries webhook-id, webhook-timestamp and webhook-signature. The signature is v1, and a base64 HMAC-SHA256 over <webhook-id>.<webhook-timestamp>.<raw body>, keyed with the base64-decoded part of the endpoint's secret after whsec_. Verify the raw body before you parse it, and refuse a timestamp more than 5 minutes from now.
// app/api/esigncomply/webhook/route.ts
import { EsignComply } from "esigncomply";
const esc = new EsignComply(process.env.ESIGNCOMPLY_API_KEY);
export async function POST(request: Request) {
// Verify the raw body, byte for byte, before parsing it.
const rawBody = await request.text();
const { data: event, error } = await esc.webhooks.verify(
rawBody,
request.headers,
process.env.ESIGNCOMPLY_WEBHOOK_SECRET!,
);
if (error) return new Response("Invalid signature", { status: 400 });
if (event.type === "record.completed") {
// event.data holds the fields listed on this page.
}
return new Response(null, { status: 200 });
}
Without the SDK, compute the same HMAC yourself: the code is under Verify the signature.
Retries
A delivery succeeds when your endpoint answers with a status from 200 to 299 within 10 seconds. Any other status, a redirect, a timeout or a network error is a failure. A failed delivery is tried again on this schedule, 14 attempts in all:
| Attempt | Wait after the attempt before | Time since the first attempt |
|---|---|---|
| 1 | none | 0 |
| 2 | 30 seconds | 30 seconds |
| 3 | 2 minutes | 2 minutes 30 seconds |
| 4 | 10 minutes | 12 minutes 30 seconds |
| 5 | 30 minutes | 42 minutes 30 seconds |
| 6 | 1 hour | 1 hour 42 minutes 30 seconds |
| 7 | 2 hours | 3 hours 42 minutes 30 seconds |
| 8 | 4 hours | 7 hours 42 minutes 30 seconds |
| 9 | 8 hours | 15 hours 42 minutes 30 seconds |
| 10 | 12 hours | 27 hours 42 minutes 30 seconds |
| 11 | 12 hours | 39 hours 42 minutes 30 seconds |
| 12 | 12 hours | 51 hours 42 minutes 30 seconds |
| 13 | 12 hours | 63 hours 42 minutes 30 seconds |
| 14 | 8 hours 17 minutes 30 seconds | 72 hours |
After attempt 14 fails, the delivery is marked failed and is not tried again. Each attempt has a new webhook-timestamp and signature over the same webhook-id and body. An endpoint whose deliveries have failed for more than 5 days is disabled on its next failed attempt, and the owners of the organization get an email. Read what was sent with List webhook deliveries.
Handle record.completed idempotently
Grant access or mark the agreement as signed for the signer in signer_external_id. Before you do, check livemode, the signer and the document versions against state your server owns. GET /v1/records/{id} with a secret key returns the record's current state.
Deliveries are at-least-once and their order is not guaranteed. Store each webhook-id you have handled and return 200 at once when you see it again. Read the object from the API when you need its current state, and return 200 for event types your handler does not know.
Questions about record.completed
When is record.completed sent?
It is sent when a record is durably written and its receipt is signed. The delivery is a signed POST to every enabled endpoint that subscribes to record.completed or to all events.
Is record.completed sent in test mode?
Yes. It is sent in test mode and in live mode. A test event goes to the endpoints created with a test key, and a live event to the endpoints created with a live key.
How do I subscribe to record.completed?
Name it in the events list of a webhook endpoint, or subscribe the endpoint to all events with "*". Create the endpoint with POST /v1/webhooks or in the dashboard. An endpoint with no events list receives every type.
Is a failed record.completed delivery retried?
Yes. A delivery that does not get a 2xx answer within 10 seconds is tried again, up to 14 attempts over 72 hours. An endpoint that keeps failing for more than 5 days is disabled, and the owners of the organization are told by email.
Can record.completed arrive more than once?
Yes. Deliveries are at-least-once, and a retry carries the same webhook-id and the same body. Make the handler do its work once for each webhook-id, and treat the event as a statement about the object rather than as a counter.
How do I verify a record.completed delivery?
Check the webhook-signature header against the raw request body with the signing secret of the endpoint. The signature is an HMAC-SHA256 over the webhook-id, the webhook-timestamp and the body, joined by full stops. Refuse a delivery whose timestamp is more than 5 minutes from now.
Related
- Webhooks: delivery, the signature, retries and every event type.
record.anchored: sent when the checkpoint that contains a live record is covered by a public anchor.record.copy_bounced: sent when the signer's receipt email could not be sent, or a test bounce was forced.record.copy_delivered: sent when the signer's receipt email was accepted by the email provider.record.disputed: sent when a signer says "This was not me" about a record from their receipt link.record.timestamped: sent when the timestamp is attached to a record, after the record is written.- Create a webhook endpoint: subscribe a URL to event types.
- Send a test webhook event: check your handler before a real event arrives.
Last updated · API version 2026-11-21