OneSignal Help & Documentation

Welcome to the OneSignal New IA developer hub. You'll find comprehensive guides and documentation to help you start working with OneSignal New IA as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Discussions

OneSignal API

OneSignal features - About the OneSignal Server REST API

Advanced Topic

OneSignal's server API can be used to:

  1. Programmatically deliver notifications from your server or device to another device.

  2. Add, update, and fetch data for your users without using our mobile or web SDKs.

  3. Export User or Notification data from OneSignal.

Our API covers:

  1. Apps

  2. Players (also known as devices or users)

  3. Notifications

Our API can be accessed using any regular HTTP library of your choice.

The most commonly used methods are:

  • Create notification - creates and sends a notification to any set of users you specify
  • Cancel notification - cancel sending a notification
  • Edit device - add/remove tags on a user or modify other properties. Normally handled automatically by our Client SDK.
  • View apps - view the details of apps on your OneSignal account
  • CSV export - export your user list

You can find our full API Reference here.


Tag Filter Target and Exclude By Topics

1. Figure out Tag categories

More details in our Add Data Tags, for example:

"breaking": 1
"sports": 1
"finance": 1
"politics": 1

The tag "key" will be the topic and the value can be whatever you like. In the example: "1" can indicate how many times the user visited the topic or you can use Time Operators to know how long since they last viewed the topic. Another common setup is to Tag based on Subscription page.

2. Target by filters

For news that crosses both "politics" and "breaking" you can use API filters to target these users without overlap.

For example:

filters: [
  {"field": "tag", "key": "politics", "relation": "exists"},
  {"operator": "OR"},
  {"field": "tag", "key": "breaking", "relation": "exists"}
]

In this example, all users with either the "politics" or "breaking" tags will get the notification. Our system will automatically make sure no users with both tags will get it twice as long as they are targeted in the same API call.

3. Exclude Segments

If you later want to send this same article to "finance" users, you can make sure none of them get duplicates if you use the example:

filters: [
{"field": "tag", "key": "politics", "relation": "not_exists"},
{"field": "tag", "key": "breaking", "relation": "not_exists"},
{"field": "tag", "key": "finance", "relation": "exists"}
]

This will make sure that only users with the "finance" tag will get the push.

OneSignal API


OneSignal features - About the OneSignal Server REST API

Advanced Topic

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.