Skip to main content

Prerequisites

Setup

1

Get your OneSignal keys

In OneSignal, open accounts and keys and copy your App ID and REST API Key.
2

Configure in Courier

Open the in Courier, enter your App ID and REST API Key, then click “Save.”

Profile requirements

Device tokens live on the user profile rather than on the send, so one profile can hold tokens for several devices and every push provider reads them from the same place. covers the model. OneSignal addresses the recipient by PlayerId or ExternalId. Store either one once with , which merges into the profile and creates it if it doesn’t exist:
The id OneSignal assigned the device.
Then send to user_id and Courier resolves the address. For a one-off with no stored profile, pass it inline instead: "to": { "oneSignalPlayerID": "YOUR_ONESIGNAL_PLAYER_ID" }.

Send by user id

The call in every language, and the rest of the profile object.

Send to a recipient

Courier reads oneSignalPlayerID off the saved profile, so preferences apply and the value can change without touching this code.

Overrides

covers the two levels and which one wins. lists the fields every push provider takes. A provider override changes the request body Courier sends to OneSignal’s API, and takes any field supported by OneSignal’s Create notification endpoint.

Data mapping

OneSignal caps the size of a push payload. In automated workflows that batch sends, a data payload can exceed that cap and the send fails. Enable data mapping on the push channel to choose which fields reach the provider. covers the template setting.

OneSignal Data Mapping

Provider details

Courier recommends routing to the channel. Naming this key in routing.channels instead is supported, and sends through just this provider.

Send to a specific provider

When that is worth doing, and what you give up: failover, channel priority, and providers you add later.