View messages
View the details for a collection of messages.
Documentation Index
Fetch the complete documentation index at: https://documentation.onesignal.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The View messages API fetches data for up to 50 push, email, or SMS messages at a time. To fetch a single message, use the View message API. In most cases, use Event Streams instead. This API does not return Journey-sent messages. See Journey analytics for details. Messages sent through the API are retained for 30 days after creation; messages sent through the OneSignal dashboard are retained for the app’s lifetime. See Rate limits for details on how often you can pull your message data with this API.How to use this API
Use time-offset pagination for sequential pulls of all messages, and standard pagination for ad-hoc queries. For ETL or bulk export pipelines, use Event Streams instead. Filter results to a specific message kind or template using thekind and template_id query parameters. Both filters work with either pagination style.
Optimized pagination with time offset
To efficiently retrieve all available messages for an app, usetime_offset-based pagination. When time_offset is specified, the sort order changes from descending to ascending — the oldest messages appear first based on the send_after date.
Accepted time_offset values
- ISO 8601 formatted timestamp — for example,
2025-01-01T00:00:00.000Z(January 1, 2025, at 00:00 UTC). - Opaque cursor token (Base64-encoded) — provided in the API response as
next_time_offset.
Initial fetch
time_offset to an ISO 8601 formatted timestamp. For example, to retrieve messages sent since January 1, 2025: time_offset=2025-01-01T00:00:00.000Z.time_offsetcannot be used with the standardoffsetparameter.time_offsetexcludes messages that match the exact timestamp to avoid duplicates.- The response includes
next_time_offset, a cursor token for the next page. No decoding required. For example:"next_time_offset": "MjAyNS0wMi0xOVQxOToxNjo0OS41Njg5NTFaIzQ2ZWVjMTAzLWQ5OGYtNGQzZC04MzA5LWQxNWI1M2QzMjQ5Nw=="
Fetch additional pages
next_time_offset from the previous response as the time_offset value in the next request. For example: time_offset=MjAyNS0wMi0xOVQxOToxNjo0OS41Njg5NTFaIzQ2ZWVjMTAzLWQ5OGYtNGQzZC04MzA5LWQxNWI1M2QzMjQ5Nw==.Continue until completion
notifications array is returned, indicating all messages have been fetched.Standard pagination
Use thelimit and offset parameters to page through notifications for an app. The maximum result size is 50, and the default limit is 50. Use limit to specify the result size and offset to increment by the limit value with each request.
For example, the first request uses offset=0, the second offset=50, the third offset=100, and so on.
Standard pagination is convenient for ad-hoc queries but degrades as the offset value grows. For sequential pulls of all messages, use time-offset pagination.
Headers
Your App API key with prefix Key . See Keys & IDs.
Query Parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
Specifies the maximum number of messages to return in a single query. The maximum and default is 50 messages per request.
Controls the starting point for the notifications being returned. Default is 0. Results are returned and sorted in descending order by queued_at.
Specifies which push notifications to return based on how it was created. Use this to segment push by their creation method, allowing for targeted analysis or management of notification types. All push types are returned by default. 0 - Notifications created through the dashboard. 1 - Notifications sent via API calls. 3 - Notifications triggered through automated systems.
An ISO 8601 formatted timestamp or Base64 integer token (provided in the API response). See time_offset Accepted Values.
Response
200
Returns all message properties for up to 50 messages per request. See the Push notifications, Email, and/or SMS Message Create APIs for all properties. Most commonly used properties for this endpoint are listed.
The total number of messages available in the dashboard irrespective of page
The time_offset if specified in the request.
A Base64 integer token representing the next group of messages to fetch if time_offset provided.
The offset specified. Defaults to 0 if not provided in the request.
The limit specified. Defaults to 50 if not provided in the request.
An array of message objects. notifications: [] indicates no more messages to fetch. The data provided is generally the most desired from this request