Programmatic Notifications

In addition to the OneSignal web portal you may use OneSignal's Server REST API to send push notifications programmatically.

OneSignal's REST API is documented at

When sending notifications through OneSignal's API, you may target users by specifying predefined segments, filtering by parameters, or specific OneSignalUserIds or other identifiers.

Send to Segments

Segments are the most common way to target large groups of devices. You may specify which segments you want to target and, optionally, which ones you don't want to receive the notification. See Custom Tags for details on using tags to create segments, both programmatically and by allowing users to self-subscribe.

Programatically send notification to segments

Send to Specific Devices

You can programmatically send a push notification to a specific device based on Player Id or using an External User Id. See Personalized Push for details on configuring each of these strategies.

Programmatically send notification to specific devices