Overview
This API mirrors the Audience Activity CSV export functionality available in the OneSignal dashboard. It lets you download a full list of event records (e.g., sends, clicks, failures) for push, email, and SMS messages: The output varies depending on the channel used by the message.How to use this API
You will need theid
of the message you want to export. You can retrieve this via the Create Message or View Messages APIs.
After you make this request, you will likely get a 200 OK
response with a csv_file_url
.
Example successful response:
200 OK
404
with the following error:
404 CSV GET
- The CSV download URL is valid for 3 days after creation.
- File names contain a random UUID to prevent guessing.
- Only one concurrent export is allowed per OneSignal account. Always download the
.csv.gz
file before starting a new export.
csv_file_url
. If the file is ready, it will download. If not, retry after some delay.
CSV data contents
The exported CSV includes the following fields:external_user_id
— Maps to the External ID. See Users.subscription_id
— Maps to the Subscription ID. See Subscriptions.device_type
— The platform/channel the Subscription is for.sent
— Timestamp of when the message was sent.delivered
— Timestamp of confirmed delivery. See Confirmed Delivery.clicked
— Timestamp of click event (if any).onesignal_id
— Maps to the internal OneSignal User ID.failed
— Timestamp of delivery failure.unsubscribed
— Timestamp of unsubscription event.failure_message
— Description of the failure, if any. See Push message reports.
Headers
Your App API key with prefix Key
. See Keys & IDs.
Path Parameters
The identifier of the message in UUID v4 format. Get this id
in the response of your Create Message API request, the View Messages API, and in your OneSignal dashboard Message Reports.
Query Parameters
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
Response
200
The URL to download the CSV file. The file is available for 3 days after generation.