Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.

Commit 82c68d4

Browse files
authored
Merge pull request #177 from notificationapi-com/OHBV5uaK/3175-webhook-doc
Update webhook documentation to include detailed failure event types
2 parents 9515161 + b5f3687 commit 82c68d4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/features/events-webhook.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,24 @@ You can easily configure your webhook endpoints and select which events to track
4545

4646
The webhook currently supports the following notification events:
4747

48-
| Event | Description | Payload |
49-
| ------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
50-
| `EMAIL_OPEN` | Triggered when a recipient opens an email notification | `{ eventType: "OPEN", trackingId: string, notificationId: string, channel: "EMAIL", userId: string }` |
51-
| `EMAIL_CLICK` | Triggered when a recipient clicks a link in an email notification | `{ eventType: "CLICK", trackingId: string, notificationId: string, channel: "EMAIL", userId: string }` |
52-
| `FAILED` | Triggered when a notification fails to deliver (for any channel type) | `{ eventType: "FAILED", trackingId: string, notificationId: string, channel: Channels, userId: string }` |
48+
| Event | Description | Payload |
49+
| ------------------ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
50+
| `EMAIL_OPEN` | Triggered when a recipient opens an email notification | `{ eventType: "OPEN", trackingId: string, notificationId: string, channel: "EMAIL", userId: string }` |
51+
| `EMAIL_CLICK` | Triggered when a recipient clicks a link in an email notification | `{ eventType: "CLICK", trackingId: string, notificationId: string, channel: "EMAIL", userId: string }` |
52+
| `EMAIL_FAILED` | Triggered when an email notification fails to deliver | `{ eventType: "EMAIL_FAILED", trackingId: string, notificationId: string, channel: "EMAIL", userId: string }` |
53+
| `SMS_FAILED` | Triggered when an SMS notification fails to deliver | `{ eventType: "SMS_FAILED", trackingId: string, notificationId: string, channel: "SMS", userId: string }` |
54+
| `CALL_FAILED` | Triggered when a call notification fails | `{ eventType: "CALL_FAILED", trackingId: string, notificationId: string, channel: "CALL", userId: string }` |
55+
| `PUSH_FAILED` | Triggered when a mobile push notification fails to deliver | `{ eventType: "PUSH_FAILED", trackingId: string, notificationId: string, channel: "PUSH", userId: string }` |
56+
| `WEB_PUSH_FAILED` | Triggered when a web push notification fails to deliver | `{ eventType: "WEB_PUSH_FAILED", trackingId: string, notificationId: string, channel: "WEB_PUSH", userId: string }` |
57+
| `INAPP_WEB_FAILED` | Triggered when an in-app web notification fails to deliver | `{ eventType: "INAPP_WEB_FAILED", trackingId: string, notificationId: string, channel: "INAPP_WEB", userId: string }` |
5358

5459
## Setting Up Your Webhook
5560

5661
To receive notification events:
5762

5863
1. Create a publicly accessible API endpoint that can receive HTTP POST requests
5964
2. Configure your webhook URL in the NotificationAPI dashboard
60-
3. Select which events you want to receive (EMAIL_OPEN, EMAIL_CLICK, FAILED)
65+
3. Select which events you want to receive (EMAIL_OPEN, EMAIL_CLICK, EMAIL_FAILED, SMS_FAILED, etc.)
6166
4. Implement proper validation of incoming webhook requests
6267
5. Process and store the event data as needed for your use case
6368

@@ -67,13 +72,13 @@ To receive notification events:
6772
A: Webhook requests are sent as HTTP POST requests with JSON payloads containing event details such as eventType, trackingId, notificationId, channel, and userId.
6873

6974
**Q: Can I filter which events I receive?**
70-
A: Yes, you can select which events to receive (EMAIL_OPEN, EMAIL_CLICK, FAILED) in the dashboard configuration.
75+
A: Yes, you can select which events to receive (EMAIL_OPEN, EMAIL_CLICK, EMAIL_FAILED, SMS_FAILED, etc.) in the dashboard configuration.
7176

7277
**Q: What response should my endpoint return?**
7378
A: Your endpoint should return a 2xx HTTP status code to acknowledge successful receipt of the webhook.
7479

75-
**Q: When would I receive a FAILED event?**
76-
A: You'll receive a FAILED event whenever a notification on any channel (email, SMS, push, etc.) fails to deliver to the recipient. This could happen for various reasons like invalid recipient details, network issues, service provider failures, or user-specific delivery problems. This event helps you track delivery failures across all your notification channels.
80+
**Q: When would I receive failure events?**
81+
A: You'll receive channel-specific failure events (EMAIL_FAILED, SMS_FAILED, CALL_FAILED, etc.) whenever a notification fails to deliver through the respective channel. This could happen for various reasons like invalid recipient details, network issues, service provider failures, or user-specific delivery problems. These events help you track delivery failures across specific notification channels.
7782

7883
**Q: Can I delete or update my webhook configuration?**
7984
A: Yes, you can update your webhook URL or selected events at any time from the dashboard. You can also delete your webhook configuration if you no longer need it.

0 commit comments

Comments
 (0)