Set up HTTP webhooks to receive real-time notifications when users display, click, or dismiss web push notifications. Complete guide with examples for Chrome, Firefox, and Safari browser support.
Browser | Platform Support | Webhook Events Available |
---|---|---|
Chrome | macOS, Windows, Android | All events (display, click, dismiss) |
Firefox | macOS, Windows, Android | Display and click events |
Safari | Not supported | None |
Enable webhooks in your OneSignal dashboard settings
cors
setting determines what headers and data your webhook endpoint receives:
cors: false
(Recommended): Simpler setup, no CORS configuration needed on your servercors: true
: Provides additional headers but requires CORS support on your servercors: true
:
Content-Type: application/json
headerX-OneSignal-Event
header for easier event identificationField | Type | Description | Always Present |
---|---|---|---|
event | string | Event type that triggered the webhook | ✅ |
notificationId | string | Unique OneSignal notification identifier | ✅ |
heading | string | Notification title | Only if provided |
content | string | Notification message body | Only if provided |
additionalData | object | Custom data sent with notification | Only if provided |
actionId | string | ID of clicked action button (empty string = notification body clicked) | Click events only |
url | string | Launch URL for the notification | Only if provided |
subscriptionId | string | OneSignal user/subscription ID | CORS enabled only |
notificationId
field to deduplicate events.
notification.dismissed
event only works in Chrome