OneSignal REST API connects to a Nagent workspace with an API key. Once it is connected, agents can call 15 OneSignal REST API actions, such as "Create Notification", "Create Template" and "Create User". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against OneSignal REST API, with input parameters and output schema.
ONESIGNAL_REST_API_BEGIN_LIVE_ACTIVITYTool to start a Live Activity on OneSignal. Use when you need to initiate a Live Activity session with a push token and subscription ID.
Input parameters
The OneSignal App ID for your app. Available in Keys & IDs.
The device's push token for Live Activities (64-character hexadecimal string)
Live Activity record ID
The OneSignal subscription ID associated with the device
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_CREATE_NOTIFICATIONTool to create and send a OneSignal push notification. Use when you have your message and target audience ready to dispatch notifications.
Input parameters
URL to open when the notification is tapped
Custom key/value data payload
Your OneSignal App ID
Action buttons; see OneSignal docs for fields (id, text, icon, url)
Advanced audience filters; see OneSignal docs for syntax
Notification message per language
Notification title per language
Notification subtitle per language
Custom iOS sound file
URL for Android large icon
Schedule delivery time in ISO 8601 format (e.g., '2023-09-01T12:00:00Z')
URL for Android big picture
Additional OneSignal parameters not explicitly modeled above
Custom Android sound file
Delay delivery based on 'timezone' or 'last-active'
iOS media attachments mapping identifiers to URLs
Predefined audience segments (e.g., \['All'\])
Android channel ID to post notification to
Specific device/player IDs to send the notification to
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_CREATE_TEMPLATETool to create reusable message templates for push, email, and SMS channels. Use when you need to create a template that can be accessed through both the dashboard and API using a template_id.
Input parameters
Associated URL for the notification
Platform targeting flag for Windows Phone (defaults to true)
Internal name for organizing and tracking templates (maximum 128 characters)
Platform targeting flag for Amazon (defaults to true)
Platform targeting flag for iOS (defaults to true)
Required to be set true for SMS templates
Your OneSignal App ID
Platform targeting flag for Microsoft Edge (defaults to true)
Required to be set true for email templates
The main message body with language-specific values (e.g., {'en': 'Hello!'}). Applies to push and SMS templates. Supports message personalization.
Language-specific heading values for push notifications
Platform targeting flag for Chrome Apps (defaults to true)
Platform targeting flag for macOS (defaults to true)
Platform targeting flag for Safari (defaults to true)
Platform targeting flag for Windows Push Notification Services (defaults to true)
Platform targeting flag for Android (defaults to true)
Platform targeting flag for Firefox (defaults to true)
The body of the email in HTML format (required when creating email templates). Supports message personalization.
Platform targeting flag for Chrome Web Push (defaults to true)
The subject of the email (required when creating email templates). Supports message personalization.
Enables programmatic personalization without CSV uploads. Structure supports nested key-value campaign variations.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_CREATE_USERTool to create a OneSignal user with optional subscriptions and aliases. Aliases provided in the payload will be used to look up an existing user.
Input parameters
Your OneSignal App ID
Identity object for user identification. Aliases provided will be used to look up an existing user.
User properties including location, activity, and custom data.
List of subscriptions (devices/channels) owned by the user
Options for subscription management.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_DELETE_ALIASTool to delete an alias by alias label from a OneSignal user. Use when you need to remove a specific alias identity from a user's profile.
Input parameters
The OneSignal App ID
The value of the alias to identify the user
The alias label to identify the user (e.g., 'external_id', 'email')
The alias label to delete from the user's identity (e.g., 'email', 'phone_number')
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_DELETE_DEVICETool to delete a device (player) from a OneSignal app. Use when you need to remove a specific device by its player ID.
Input parameters
The OneSignal App ID
The OneSignal Player (Device) ID to delete
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_FETCH_USER_IDENTITYTool to retrieve all aliases for a user identified by a specific alias. Use when you need to fetch the complete identity mapping for a OneSignal user.
Input parameters
Your OneSignal App ID.
The alias value/ID to identify the user (e.g., 'test-user-123', 'user@example.com').
The alias label to identify the user (e.g., 'external_id', 'email', 'phone_number').
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_GET_ELIGIBLE_IAMSTool to retrieve the manifest of In-App Messages that a subscription is eligible to display. Use when you need to fetch eligible IAMs for a specific subscription.
Input parameters
Unique identifier for the OneSignal app.
Unique identifier for the subscription (device/player).
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_UPDATE_DEVICETool to update properties of an existing device. Use when you need to modify device attributes after registration.
Input parameters
Custom tags for the device
Advertising ID
Your OneSignal App ID
Country code, e.g., 'US'
Language code, e.g., 'en'
Latitude coordinate
Total playtime in seconds
Timezone offset in seconds from UTC
Operating system version
Longitude coordinate
Unique OneSignal device/player ID
1 for development, 2 for ad-hoc
Unix timestamp when the device was created
Push token, email address, or external user ID
iOS badge count
Device type. See OneSignal docs for list
Unix timestamp when the device was last active
Amount the user has spent
Device model
Version of the app/game
SMS authentication hash
Email authentication hash
External user ID
Additional custom attributes
Notification permission state
Auth hash for external_user_id
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_UPDATE_SUBSCRIPTIONTool to update an existing subscription's properties. Use when you need to modify subscription attributes like token, enabled status, or device information.
Input parameters
Your OneSignal App ID.
The subscription properties to update.
The unique ID of the subscription to update.
Whether to retain the previous owner when updating the subscription.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_VIEW_AN_APPTool to retrieve metadata for a single OneSignal app. Use when you need to fetch app details by its ID.
Input parameters
Unique identifier for the OneSignal app.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_VIEW_DEVICETool to retrieve details of a specific device (player). Use when you have a OneSignal player_id and need current device info.
Input parameters
Your OneSignal App ID.
Unique ID of the device (player) to retrieve.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_VIEW_DEVICESTool to retrieve a paginated list of devices (players) for a OneSignal app. Use when you need to list or audit all registered devices for a given app.
Input parameters
Maximum number of devices to return (1-300). Defaults to 300.
Your OneSignal App ID.
Pagination offset. Defaults to 0.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_VIEW_NOTIFICATIONSTool to retrieve details of multiple notifications. Use when you need to list notifications for a specific app.
Input parameters
Maximum number of notifications to return (1-300). Defaults to 50.
Your OneSignal App ID.
Result offset for pagination. Defaults to 0.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
ONESIGNAL_REST_API_VIEW_SEGMENTSTool to view segments for a OneSignal app. Use when you need to list all segments associated with an app.
Input parameters
Maximum number of segments to return (1-300). Default is 50.
OneSignal App ID to list segments for
Zero-based offset for pagination. Results sorted by creation time.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 15 OneSignal REST API actions on Nagent, including "Create Notification", "Create Template" and "Create User". Create Notification: Create and send a OneSignal push notification. Each action is listed on this page with its input parameters and its output.
OneSignal REST API connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Create Notification takes 2 required inputs: app_id and contents. It also takes 17 optional inputs: url, data, buttons, filters, headings, subtitle, ios_sound, large_icon, send_after, big_picture, extra_params, android_sound, delayed_option, ios_attachments, included_segments, android_channel_id and include_player_ids. It returns data, error and successful.