You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(webhooks): enhance message event documentation and clarify email activity tracking
Updated the message events section to explain the sources of `message.*` events and their relationship with email activity tracking. Added detailed descriptions for each event type, including `message.sent`, `message.delivered`, and `message.seen`. Clarified the necessity of enabling both email activity tracking and outbound webhooks for proper event handling. Improved troubleshooting guidance for common issues related to event visibility in Novu.
Copy file name to clipboardExpand all lines: content/docs/platform/developer/webhooks/event-types.mdx
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,34 @@ Each event includes detailed information about the affected resource and the cha
15
15
16
16
## Message events
17
17
18
+
### Where message events come from
19
+
20
+
Not every `message.*` event is triggered the same way. Some fire when Novu sends a notification; others arrive later from your delivery provider or from subscriber actions in the Inbox.
|`message.sent`| Novu worker, right after the provider accepts the send | No |
25
+
|`message.failed`| Novu worker (send error) or provider bounce/drop via activity tracking | Partial — provider failures need activity tracking |
26
+
|`message.delivered`| Provider inbound webhook (for example, SendGrid `delivered`) | Yes, for email |
27
+
|`message.seen`| Provider inbound webhook (for example, SendGrid `open`) or Inbox | Yes, for email opens from the provider |
28
+
29
+
<Callout>
30
+
**`message.sent` vs `message.delivered` (email)**
31
+
32
+
-**`message.sent`** means Novu successfully handed the email to SendGrid (or another provider). It fires immediately.
33
+
-**`message.delivered`** means the provider later confirmed the recipient's mail server received the email. It only arrives if [Email Activity Tracking](/platform/integrations/email/activity-tracking) is enabled on the integration that sent the message.
34
+
35
+
Seeing `message.sent` in your outbound webhook logs does not mean delivery or open tracking is configured.
36
+
</Callout>
37
+
38
+
### Event reference
39
+
18
40
-`message.archived`: This webhook is triggered when a subscriber archives a message. The payload contains the details of the event.
19
-
-`message.delivered`: This webhook is triggered when a message delivery provider acknowledged the message delivery to the end receiving client. The payload contains the details of the event.
20
-
-`message.failed`: This webhook is triggered when Novu tries to send the message to the delivery provider and it got failed. The payload contains the details of the event.
21
-
-`message.read`: This webhook is triggered when a message has been read by the subscriber. The payload contains the details of the event.
22
-
-`message.seen`: This webhook is triggered when a subscriber opens a message. The payload contains the details of the event.
23
-
-`message.sent`: This webhook is triggered when Novu sends the message to the delivery provider. The payload contains the details of the event.
41
+
-`message.delivered`: This webhook is triggered when a delivery provider confirms the message was delivered to the recipient's mail server (for email, via [activity tracking](/platform/integrations/email/activity-tracking)). The payload contains the details of the event.
42
+
-`message.failed`: This webhook is triggered when Novu fails to send the message to the provider, or when the provider reports a bounce, drop, or block (via activity tracking). The payload contains the details of the event.
43
+
-`message.read`: This webhook is triggered when a message has been read by the subscriber (for example, via the Inbox). The payload contains the details of the event.
44
+
-`message.seen`: This webhook is triggered when a message is opened. For email, provider open events (for example, SendGrid `open`) are forwarded as `message.seen` — not `message.opened`. The payload contains the details of the event.
45
+
-`message.sent`: This webhook is triggered when Novu hands the message off to the delivery provider. The payload contains the details of the event.
24
46
-`message.snoozed`: This webhook is triggered when a message is snoozed by the subscriber. The payload contains the details of the event.
25
47
-`message.unarchived`: This webhook is triggered when an archived message is unarchived. The payload contains the details of the event.
26
48
-`message.unread`: This webhook is triggered when a message is unread or marked as unread by the subscriber. The payload contains the details of the event.
Copy file name to clipboardExpand all lines: content/docs/platform/developer/webhooks/index.mdx
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,3 +190,22 @@ To secure your webhook endpoint, you should:
190
190
### How can I test webhooks locally?
191
191
192
192
To test webhooks locally, you can use a service like ngrok or localtunnel to expose your local server to the internet. Alternatively, you can use webhook testing services like Webhook.site or RequestBin to inspect webhook payloads.
193
+
194
+
### Why do I see `message.sent` but not `message.delivered` or `message.seen` for email?
195
+
196
+
These events come from different stages of the email lifecycle:
197
+
198
+
-**`message.sent`** — Novu successfully sent the email to the provider (for example, SendGrid). This does not require [Email Activity Tracking](/platform/integrations/email/activity-tracking).
199
+
-**`message.delivered`** — The provider confirmed delivery to the recipient's mail server. Requires activity tracking on the sending integration.
200
+
-**`message.seen`** — The recipient opened the email. SendGrid `open` events are forwarded as `message.seen` (not `message.opened`). Requires activity tracking on the sending integration.
201
+
202
+
You need both [Email Activity Tracking](/platform/integrations/email/activity-tracking) on your provider integration **and** an outbound webhook endpoint subscribed to `message.delivered` and `message.seen`.
203
+
204
+
### I see delivery or open events in SendGrid but not in Novu outbound webhooks
205
+
206
+
1. Confirm **Email Activity Tracking** is enabled on the SendGrid integration that sends your emails.
207
+
2. Confirm your outbound endpoint is subscribed to **`message.seen`** and **`message.delivered`** (not `message.opened`).
208
+
3. In SendGrid → **Event Webhook** → check **delivery history** for POSTs to your Novu inbound URL. The SendGrid activity UI and third-party integrations can show events that were never posted to Novu.
209
+
4. If you have multiple SendGrid integrations, verify the Event Webhook **Post URL** matches the [Inbound Webhook URL](/platform/integrations/email/activity-tracking/manual-configuration/sendgrid) for the integration that sends the emails.
210
+
211
+
See the [SendGrid activity tracking troubleshooting](/platform/integrations/email/activity-tracking/manual-configuration/sendgrid#troubleshooting) section for more detail.
description: "Learn how Novu webhooks work, including event types, payload schemas, signature verification, and endpoint configuration."
5
5
---
6
6
7
-
## The Intro
7
+
<Callout>
8
+
This page is a legacy draft. Use the current documentation instead:
8
9
9
-
Webhooks are how services notify each other of events.
10
-
11
-
At their core they are just a POST request to a pre-determined endpoint.
12
-
The endpoint can be whatever you want, and you can just add them from the UI.
13
-
You normally use one endpoint per service, and that endpoint listens to all of the event types.
14
-
15
-
For example, if you receive webhooks from Novu, you can structure your URL like: `https://www.example.com/novu/webhook/`.
16
-
17
-
The way to indicate that a webhook has been processed is by returning a 2xx (status code 200-299) response to the webhook message within a reasonable time-frame (15s).
18
-
19
-
It's also important to disable CSRF protection for this endpoint if the framework you use enables them by default.
20
-
21
-
Another important aspect of handling webhooks is to verify the signature and timestamp when processing them.
22
-
23
-
You can learn more about it in the signature verification section.
24
-
25
-
## Events and event types
26
-
27
-
The core value of webhooks is to notify users when events happen, so it's extremely important to understand what events are available and their payload schemas.
28
-
29
-
Novu webhooks allow you to receive notifications when specific events occur in your Novu account. These events include workflow updates, subscriber changes, and message delivery status updates.
30
-
31
-
### Supported event types
32
-
33
-
Novu supports the following webhook event types:
34
-
35
-
-**Workflow Events**: Events about workflow creation, updates, and deletions,
36
-
-**Message Events**: Events about message delivery status changes
37
-
-**Preference Events**: Events about subscriber preference changes
38
-
39
-
Each event includes detailed information about the affected resource and the changes that occurred.
40
-
41
-
#### Workflow Events
42
-
43
-
-**workflow.created**: Triggered when a workflow is created
44
-
-**workflow.updated**: Triggered when a workflow is updated
45
-
-**workflow.deleted**: Triggered when a workflow is deleted
46
-
-**workflow.published**: Triggered when a workflow is synced from dev to prod environment
47
-
48
-
#### Message Events
49
-
50
-
-**messages.archived**: Triggered when a message is archived.
51
-
-**messages.unarchived**: Triggered when a message is unarchived.
52
-
-**messages.read**: Triggered when a message is read.
53
-
-**messages.unread**: Triggered when a message is unread.
54
-
-**messages.seen**: Triggered when a message is seen.
55
-
-**messages.snoozed**: Triggered when a message is snoozed.
56
-
-**messages.unsnoozed**: Triggered when a message is unsnoozed.
57
-
-**messages.sent**: Triggered when Novu sends the message to the delivery provider.
58
-
-**messages.delivered**: Triggered when a message delivery provider acknowledged the message delivery to the end receiving client.
59
-
-**messages.failed**: Triggered when Novu tried to send the message to the delivery provider and it got failed.
60
-
61
-
#### Preference Events
62
-
63
-
-**preference.updated**: Triggered when subscriber preference is updated.
64
-
65
-
## How to add an endpoint
66
-
67
-
To start listening to messages, you will need to configure your endpoints.
68
-
69
-
1. Go to the [Webhooks](https://dashboard.novu.co/webhooks) page in the Novu dashboard.
70
-
2. Click **Add Endpoint**.
71
-
3. Enter the URL of your endpoint.
72
-
4. Add description for this webhook endpoint.
73
-
5. Select the event types you want to listen to.
74
-
6. Optional: add advanced configuration for your endpoint.
75
-
7. Click **Create**.
76
-
77
-
If your endpoint isn't quite ready to start receiving events, you can use a service like [Webhook.site](https://webhook.site/) or [RequestBin](https://requestbin.com/) to have a unique URL generated for you.
78
-
79
-
## How to test endpoints
80
-
81
-
Once you've added an endpoint, you'll want to make sure it's working.
82
-
83
-
The "Testing" tab lets you send test events to your endpoint.
84
-
85
-
After sending an example event, you can view the message payload, all of the message attempts, and whether it succeeded or failed.
86
-
87
-
## Verifying signatures
88
-
89
-
Webhook signatures let you verify that webhook messages are actually sent by Novu and not a malicious actor.
90
-
91
-
Verifying webhook signatures helps ensure payloads were sent by Novu and have not been tampered with. Here is an example using JavaScript:
// Throws on error, returns the verified content on success
108
-
constverifiedPayload=wh.verify(payload, headers);
109
-
```
110
-
111
-
See the library documentation for more instructions and examples of how to verify signatures in other languages.
112
-
113
-
## Retry schedule
114
-
115
-
### Retries
116
-
117
-
We attempt to deliver each webhook message based on a retry schedule with exponential backoff.
118
-
119
-
#### The schedule
120
-
121
-
Each message is attempted based on the following schedule, where each period is started following the failure of the preceding attempt:
122
-
123
-
- Immediately
124
-
- 5 seconds
125
-
- 5 minutes
126
-
- 30 minutes
127
-
- 2 hours
128
-
- 5 hours
129
-
- 10 hours
130
-
- 10 hours (in addition to the previous)
131
-
132
-
If an endpoint is removed or disabled, delivery attempts to the endpoint will be disabled as well.
133
-
134
-
For example, an attempt that fails three times before eventually succeeding will be delivered roughly 35 minutes and 5 seconds following the first attempt.
135
-
136
-
### Manual retries
137
-
138
-
You can also use the application portal to manually retry each message at any time, or automatically retry ("Recover") all failed messages starting from a given date.
139
-
140
-
## Troubleshooting & Failure Recovery
141
-
142
-
### Common reasons why your webhook endpoint is failing
143
-
144
-
There are some common reasons why your webhook endpoint is failing:
145
-
146
-
-**Not using the raw payload body**
147
-
148
-
This is the most common issue. When generating the signed content, we use the raw string body of the message payload.
149
-
150
-
If you convert JSON payloads into strings using methods like stringify, different implementations may produce different string representations of the JSON object, which can lead to discrepancies when verifying the signature. It's crucial to verify the payload exactly as it was sent, byte-for-byte or string-for-string, to ensure accurate verification.
151
-
152
-
-**Missing the secret key**
153
-
154
-
From time to time we see people simply using the wrong secret key. Remember that keys are unique to endpoints.
155
-
156
-
-**Sending the wrong response codes**
157
-
158
-
When we receive a response with a 2xx status code, we interpret that as a successful delivery even if you indicate a failure in the response payload. Make sure to use the right response status codes so we know when messages are supposed to succeed vs fail.
159
-
160
-
-**Responses timing out**
161
-
162
-
We will consider any message that fails to send a response within 15 seconds a failed message. If your endpoint is also processing complicated workflows, it may timeout and result in failed messages.
163
-
164
-
We suggest having your endpoint simply receive the message and add it to a queue to be processed asynchronously so you can respond promptly and avoid getting timed out.
165
-
166
-
### Re-enable a disabled endpoint
167
-
168
-
If all attempts to a specific endpoint fail for a period of 5 days, the endpoint will be disabled. To re-enable a disabled endpoint, go to the webhook dashboard, find the endpoint from the list and select "Enable Endpoint".
169
-
170
-
### Recovering/Resending failed messages
171
-
172
-
If your service has downtime or if your endpoint was misconfigured, you probably want to recover any messages that failed during the downtime.
173
-
174
-
If you want to replay a single event, you can find the message from the UI and click the options menu next to any of the attempts.
175
-
176
-
From there, click "resend" to have the same message send to your endpoint again.
177
-
178
-
If you need to recover from a service outage and want to replay all the events since a given time, you can do so from the Endpoint page. On an endpoint's details page, click "Options > Recover Failed Messages".
179
-
180
-
From there, you can choose a time window to recover from.
181
-
182
-
For a more granular recovery - for example, if you know the exact timestamp that you want to recover from - you can click the options menu on any message from the endpoint page.
183
-
184
-
From there, you can click "Replay..." and choose to "Replay all failed messages since this time."
185
-
186
-
## FAQs
187
-
188
-
### How do I secure my webhook endpoint?
189
-
190
-
To secure your webhook endpoint, you should:
191
-
192
-
1. Verify the webhook signature using the official verification library
193
-
2. Use HTTPS for your endpoint URL
194
-
3. Implement rate limiting to prevent abuse
195
-
4. Keep your webhook secret secure and rotate it periodically
196
-
197
-
### What happens if my endpoint is unavailable?
198
-
199
-
If your endpoint is unavailable, Novu will retry sending the webhook according to the retry schedule. If all attempts fail for 5 days, the endpoint will be disabled and you'll need to manually re-enable it.
200
-
201
-
### Can I filter webhooks by event type?
202
-
203
-
Yes, when configuring your webhook endpoint, you can select specific event types to receive. This allows you to filter out events that aren't relevant to your use case.
204
-
205
-
### How can I test webhooks locally?
206
-
207
-
To test webhooks locally, you can use a service like ngrok or localtunnel to expose your local server to the internet. Alternatively, you can use webhook testing services like Webhook.site or RequestBin to inspect webhook payloads.
10
+
-[Webhooks overview](/platform/developer/webhooks) — setup, signatures, retries, and troubleshooting
11
+
-[Event types](/platform/developer/webhooks/event-types) — full list of `message.*`, `workflow.*`, and `preference.*` events
**Activity tracking and outbound webhooks are two separate steps**
32
+
33
+
1.**Email Activity Tracking** (this guide) — lets Novu receive delivery and engagement events from your provider via an inbound webhook.
34
+
2.**[Outbound Webhooks](/platform/developer/webhooks)** — forwards selected events to your own endpoint. Subscribe to `message.delivered` and `message.seen` to receive provider delivery and open events.
35
+
36
+
Enabling only outbound webhooks is not enough. You must also enable activity tracking on the provider integration that sends your emails.
37
+
</Callout>
38
+
30
39
## Manual configuration
31
40
32
41
If auto-configuration fails or isn’t supported for your provider, you will need to set it up manually. You can do that by following these provider specific guides:
@@ -133,9 +142,23 @@ Inbound webhooks don’t just update Novu internally, they can also trigger outb
133
142
How it works:
134
143
135
144
1. A provider emits an event (for example, delivered).
136
-
2. Novu receives and normalizes the event (for example, → delivered).
145
+
2. Novu receives and normalizes the event (for example, → `delivered`).
137
146
3. Novu updates its internal message entity and step-run trace.
138
-
4. If outbound webhooks are enabled, Novu forwards the normalized event to your configured outbound webhook endpoint.
147
+
4. If [outbound webhooks](/platform/developer/webhooks) are enabled, Novu forwards the event to your configured endpoint using the outbound event names below.
148
+
149
+
#### Provider events → outbound webhook events
150
+
151
+
| Provider event (example) | Novu activity status | Outbound webhook event |
0 commit comments