Get notified when documents are signed
How-to guide5 min read
A webhook is a request Notriv sends to your server when something happens, such as a document being signed. You don't have to keep asking for status.
Add an endpoint
- Create a URL on your server that accepts POST requests
It must use https:// and be reachable from the internet.
- Open Developers, then Webhooks, then Add endpoint
Paste the URL and choose events, or leave them all unchecked to receive everything.
- Copy the signing secret
Select Reveal signing secret and store it on your server as
NOTRIV_WEBHOOK_SECRET. - Send a test event
Select Send test. It appears under Recent deliveries with the response your server gave.
Events
| Event | Sent when |
|---|---|
envelope.created | An envelope is created |
envelope.sent | It goes out to signers |
envelope.signer_completed | One signer finishes; data.signer says who |
envelope.completed | Everyone has signed; the signed PDF is ready |
envelope.voided | It is cancelled |
Every event carries the full envelope in data.object, including your metadata:
{
"id": "evt_2Hq8...",
"object": "event",
"type": "envelope.completed",
"livemode": true,
"created_at": "2026-09-27T16:20:11.000Z",
"data": { "object": { "id": "env_7Kd2...", "status": "completed", "metadata": { "crm_deal_id": "D-1042" } } }
}Verify the signature
Each request has a Notriv-Signature header. Always check it before trusting the event, using the raw request body:
import express from 'express'
import Notriv from '@notriv/node'
app.post('/notriv/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
let event
try {
event = Notriv.webhooks.constructEvent(req.body, req.headers['notriv-signature'], process.env.NOTRIV_WEBHOOK_SECRET)
} catch {
return res.sendStatus(400)
}
if (event.type === 'envelope.completed') {
markDealSigned(event.data.object.metadata.crm_deal_id)
}
res.sendStatus(200)
})Responses and retries
- Answer with any
2xxstatus within 10 seconds. Do slow work after responding. - Anything else is retried after 1, 5 and 30 minutes, then 2, 6, 12, 24 and 24 hours (about 3 days). You can resend any delivery from the dashboard.
- An event can arrive more than once or out of order. Use
event.idto skip ones you've already handled. - Missed some?
GET /v1/eventslists everything that happened.
Note
Webhook endpoints belong to one mode. Add your URL separately in test mode and in live mode.
Next steps
Was this page helpful?