Webhooks are delivered with at-least-once semantics. Your endpoint should be idempotent — use the
event_id to deduplicate.Setting Up a Webhook
Register a webhook URL in the NearNode Console under Settings → Webhooks, or via the API.Add your endpoint URL
Enter the HTTPS URL where you want to receive events (e.g.,
https://api.yourapp.com/webhooks/nearnode).Select event types
Choose which events to subscribe to. You can listen to all events or filter by type.
Copy your signing secret
A unique secret is generated for each webhook. Store it securely — you’ll use it to verify signatures.
Event Types
- Scan Events
- Node Events
- Batch Events
Fired when a node is scanned by an end user.
| Event | Description |
|---|---|
scan.created | A node was scanned (any function type) |
scan.redirect | A redirect was followed |
scan.vcard_download | A vCard was downloaded |
scan.blocked | Scan was blocked by kill switch |
Retry Policy
Failed deliveries (non-2xx response) are retried with exponential backoff:| Attempt | Delay | Total elapsed |
|---|---|---|
| 1st retry | 1 minute | 1 min |
| 2nd retry | 5 minutes | 6 min |
| 3rd retry | 30 minutes | 36 min |
Signature Verification
Every webhook request includes anX-NearNode-Signature header. Verify it to ensure the request is authentic and hasn’t been tampered with.
The signature is an HMAC-SHA256 of the raw request body using your webhook signing secret.
Best Practices
Respond quickly
Respond quickly
Return a
200 response immediately, then process the event asynchronously. Webhook delivery times out after 10 seconds — long-running processing will trigger retries.Handle duplicates
Handle duplicates
Use the
event_id field to deduplicate. Network issues or retries may deliver the same event more than once.Use HTTPS
Use HTTPS
Webhook URLs must use HTTPS. Plain HTTP endpoints are rejected during registration.
Monitor delivery
Monitor delivery
Check the Webhooks page in the console for delivery logs, response codes, and latency metrics. Set up an alert rule to notify you if deliveries start failing.