Overview
Webhooks arePOST requests sent to your endpoint when events occur in Nectar — connections created, documents processed, and more. Your endpoint should return a 2xx response within 15 seconds to acknowledge receipt. If your framework enables CSRF protection by default, disable it for the webhook endpoint.
Verify every incoming webhook using signature verification before processing.
Set up webhooks
Get your webhook portal URL
Call the configure webhook endpoint (see the API Reference tab) with your API key. The response contains a Svix portal URL valid for 7 days.
Add an endpoint
In the Svix portal, add your endpoint URL and select the event types you want to subscribe to. If you don’t select any event types, the endpoint receives all events by default.
Event types
Nectar sends the following event types:| Event type | Trigger |
|---|---|
connection.created.v2 | A new connection is created |
connection.updated.v2 | A connection’s status or details change |
connection.validated.v2 | A connection has been validated by Nectar |
document.created.v2 | A new document is processed |
document.updated.v2 | An existing document is reprocessed or updated |
connection.created.v2
Sent when a new connection is created.connection.updated.v2
Sent when a connection’s status or details change. IncludesprotectedChanges (a list of fields that changed) and old (previous values for those fields).
connection.validated.v2
Sent when a connection has been validated by Nectar. The payload shape is the same asconnection.created.v2.
document.created.v2
Sent when a new document is processed.document.updated.v2
Sent when an existing document is reprocessed or updated. Includesold with previous field values.
Signature verification
Verify webhook signatures to confirm that messages are genuinely sent by Nectar. For background on why this matters, see Why verify webhooks. Svix provides libraries that make verification straightforward:Retry schedule
Svix uses exponential backoff to retry failed deliveries. Each period starts after the preceding attempt fails:| Attempt | Delay |
|---|---|
| 1 | Immediately |
| 2 | 5 seconds |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 5 hours |
| 7 | 10 hours |
| 8 | 10 hours |
Troubleshooting
Not using the raw payload body
This is the most common issue. Signature verification uses the raw string body of the message payload. If you serialize the JSON with methods likeJSON.stringify, the output may differ from the original payload and cause verification to fail. Always verify the payload exactly as received, byte-for-byte.
Missing the secret key
Each endpoint has a unique signing secret. Confirm you’re using the correct key for the endpoint receiving the webhook.Sending the wrong response codes
A2xx status code signals successful delivery regardless of what the response body contains. Return the appropriate status code so the system knows whether delivery succeeded or failed.
Responses timing out
Any endpoint that doesn’t respond within the timeout window is treated as a failed delivery. If your endpoint processes complex workflows, receive the message, enqueue it for async processing, and return200 immediately.
Failure recovery
Re-enable a disabled endpoint
If all delivery attempts to an endpoint fail over a 5-day period, the endpoint is automatically disabled. To re-enable it, open the webhook portal, find the endpoint, and select Enable Endpoint.Replay failed messages
Use replay when your service experienced downtime or an endpoint was misconfigured.- Single message: Find the message in the portal, open the options menu next to any attempt, and click Resend.
- Bulk recovery: On the endpoint details page, select Options > Recover Failed Messages and choose a time window. For more precision, open the options menu on any message and select Replay all failed messages since this time.