View the details for a collection of messages.

Overview

The View messages API allows you to fetch data from up to 50 push, email, or SMS message at a time. If you want to get a single message's data, use the View message API. In most cases, you will likely want to use Event Streams instead.

Currently this API does not provide Journey-sent messages. See Journey analytics for details.

Messages sent through the API and Automated Messages are only accessible 30 days after creation; however, messages sent using the OneSignal dashboard are accessible for the app's lifetime.

See our Rate limits for details on how often you can pull your message data with this API.


How to use this API

You can pull 50 messages at a time and with each request, use the offset parameter to increment by 50 each time. So your first request will have offset be 0, second request will have offset be 50, third request 100, etc.

If you want to only pull messages from now to some date in the past, use the time_offset parameter and set the date as an ISO8601 formatted timestamp. For example, if you want to pull all messages sent since January 1st, 2025 at 12:00 AM UTC, your time_offset would be 2025-01-01T00:00:00.000Z in ISO 8601 format:

The time_offset corresponds to the send_after parameter which is the date and time the message started sending.

To fetch the next batch of messages, the time_offset in subsequent requests should use the value response.notifications[-1].send_after.unix_to_iso8601. There are no more messages to fetch when response.notifications.length < request.limit. Note: By appearances, it would be more consistent if this timestamp argument were a UNIX timestamp to match the send_after response field. However, to provide sufficient resolution to high volume senders, it’s helpful for the time_offset value to have millisecond precision. If we were to make it a UNIX timestamp, then we would be mixing timestamp units of milliseconds and seconds which would be rather confusing. It’s for this reason we settled on the ISO8601 format.


Response data

The properties returned will include the same properties used in the original Create message request, along with the message analytics at the time of the request.

For example, if you send a message targeting the include_aliases parameter, the response will include the aliases you set. If you send with the included_segments parameter, then the response will only provide the segments you set. When targeting segments or filters, you can use the Export audience activity CSV API to get the user event data.

The table below lists all non-customizable properties returned. Properties not listed here can be found in Push channel parameters, Email channel parameters, and SMS channel parameters, depending on the target channel.

Common ParametersDefinitions
"successful"Number of notifications delivered to the Google/Apple/Windows servers.
"failed"Number of devices reported as unsubscribed.
"errored"Number of devices with an error. See your "Settings" tab for details or contact Support.
"converted"Number of devices that have clicked/tapped the notification.

converted data will not be shown for Apple macOS & Windows (Phone & Desktop). OneSignal doesn't support SDKs for these platforms.
"received"Number of devices that confirmed receiving the notification aka Confirmed Deliveries.

received data is not available for:

- Safari Web Push
- Windows Apps
- macOS Apps
- Chrome App Extensions
"platform_delivery_stats"Hash of delivery statistics broken out by target device platform.
"queued_at"Unix timestamp indicating when the message was created.
"send_after"Unix timestamp indicating when message delivery should begin.
"completed_at"Unix timestamp indicating when message delivery was completed. The delivery duration from start to finish can be calculated with completed_at - send_after.
"throttle_rate_per_minute"Number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the message, and for Free accounts, null is returned. Refer to Throttling for more details.
"outcomes"For a list of Outcomes definitions, see View Outcomes.

Language