Overview
OneSignal’s user and subscription system enables fine-grained tracking of how users engage with your app or website across multiple messaging channels—push, email, and SMS. Each user can have multiple subscriptions, and each subscription is tied to a messaging channel and device. This structure allows you to personalize messaging, analyze behavior, and monitor cross-platform engagement. Think of Users as the parent and Subscriptions as the children. The following are the properties available when users and subscriptions are created and viewed via our APIs.Identity
These properties are used to identify and link users within your OneSignal app.OneSignal ID
- Type:
string(UUID v4) - Access: Read-only
- API Mapping:
user.identity.onesignal_id,alias_label=onesignal_id
External ID
- Type:
string - Access: Read-write
- API Mapping:
user.identity.external_id,alias_label=external_id
json
Custom alias
- Type:
string - Access: Read-write
- API Mapping:
user.identity.your_custom_alias,alias_label=your_custom_alias
external_id and use custom aliases for additional mappings.
json
User properties
Country
- Type:
string(ISO 3166-1 Alpha 2 format country code) - Access: Read-write
- API Mapping:
user.properties.country
First Session
- Type:
integer(unix timestamp in seconds) - Access: Read-write
- API Mapping:
user.properties.first_active
IP Address
- Type:
string - Access: Read-write
- API Mapping:
user.properties.ip
Language
- Type:
string(ISO 639-1) - Access: Read-write
- API Mapping:
user.properties.language
setLanguage method or Create user and Update user APIs.
See Multi-language messaging for more details.
Last session
- Type:
integer(unix timestamp in seconds) - Access: Read-write
- API Mapping:
user.properties.last_active
Location
- Type:
float(latitude and longitude) - Access: Read-write
- API Mapping:
user.properties.lat&user.properties.long
json
Tags
- Type:
object(key-value strings) - Access: Read-write
- API Mapping:
user.properties.tags
json
Timezone
- Type:
string(TZ identifier) - Access: Read-write
- API Mapping:
user.properties.timezone_id
Subscription properties
App version
- Type:
string - Access: Read-write
- API Mapping:
subscription.app_version
- Android: Android Studio
versionCodein your Appbuild.gradle - iOS: Xcode App Version
Channel
- Type:
string(enum) - Access: Read-only
- API Mapping:
subscription.type
iOSPush, AndroidPush, HuaweiPush, FireOSPush and web push subscriptions can have types like ChromePush, FirefoxPush, SafariPush. Mobile push subscriptions can receive both push and in-app messages. Web push, email, and SMS subscriptions cannot receive in-app messages.
Device
- Type:
string - Access: Read-write
- API Mapping:
subscription.device_modelandsubscription.device_os
json
- Type:
string - Access: Read-write
- API Mapping:
subscription.token
json
Phone Number
- Type:
string - Access: Read-write
- API Mapping:
subscription.token
json
Push Token
- Type:
string - Access: Read-write
- API Mapping:
subscription.token
json
SDK Version
- Type:
string - Access: Read-only
- API Mapping:
subscription.sdk
Sessions
- Type:
integer - Access: Read-write
- API Mapping:
subscription.session_count
json
Status
- Type:
boolean - Access: Read-write
- API Mapping:
subscription.enabled&invalid_identifieron CSV Export API
- Can be overridden for email subscriptions on a per-message basis. See Email unsubscribe links & headers.
- Can be updated for email and SMS subscriptions in the dashboard (options button) or via the API.
- This should only be handled by our SDK for push subscriptions. See SDK
optInandoptOutmethods for details.
Status Details
- Type:
string - Access: Read-write
- API Mapping:
subscription.notification_types
Subscription ID
- Type:
string(UUID v4) - Access: Read-only
- API Mapping:
subscriptions.id,subscription_id
json
Usage Duration
- Type:
integer(seconds) - Access: Read-write
- API Mapping:
subscription.session_time
json
FAQ
When do push subscription statuses get updated?
The subscription status will be updated in OneSignal automatically when the user:- Interacts with the OneSignal SDK You can capture this event with our SDK Subscription Observer methods and send to your Database.
- Token Expiration If the device token has been inactive for over 270 days, Google FCM will expire the token, the subscription will be marked unsubscribed when a push is sent to it. If the user opens the app on this device, our SDK will refresh the token, keeping the original subscription status.
-
Unsubscribed Notification Delivery After sending 2+ notifications to the unsubscribed device:
- Android mobile subscriptions and web push subscriptions: FCM will alert OneSignal that the device is unsubscribed after the 2nd notification is sent to the unsubscribed device.
- iOS mobile subscriptions: APNS will alert OneSignal that the device is unsubscribed after some time has passed between the user uninstalling the app or unsubscribed and has not opened the app when sending notifications to the subscription.
Example Unsubscribe Detection Flow:
- Notification 1 sent and user receives on device. The user decides to unsubscribe.
- Notification 2 sent, the OneSignal Dashboard shows “Delivered” but the user does not actually receive it.
- Notification 3 sent, the OneSignal Dashboard shows Unsubscribed for Android and web subscriptions. iOS subscriptions may take additional notifications and time for the unsubscribed event to be sent to OneSignal from Apple.
- Notification 4 will not be sent to that device.
How do I manage subscriptions across multiple devices?
Users often have multiple devices (e.g., smartphone, tablet, desktop browser) and may use your service on all of them. OneSignal automatically handles this by:- Creating separate push subscriptions for each device
- Allowing you to link these subscriptions using the External ID
- Maintaining separate push tokens while sharing user-level properties
What happens when a user changes devices?
When a user gets a new device:- Their old push subscription remains in your OneSignal account but will eventually be marked as unsubscribed
- A new push subscription is created when they install your app on the new device
- If you set the same External ID on the new device, OneSignal will link it to the same user
- User-level properties and tags will transfer to the new device automatically
How do I handle subscription deletions?
If you need to comply with data deletion requests or clean up old subscriptions:- Use the Delete User API to remove a user and all their subscriptions
- For selective deletion, use the Delete Subscription API
- Set up automated clean-up jobs to remove subscriptions older than a certain age using our API