Export audience activity CSV
Export a compressed CSV report of audience-level delivery and engagement data for a specific message. This includes sent, delivered, clicked, failed, and unsubscribed events across Push, Email, and SMS channels.
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 the id
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:
Depending on how large the file is, the URL may 404
with the following error:
The export file is generated at ~2,000 records per second. For large audiences, the file can take several minutes. Implement retries with exponential backoff or a similar strategy.
- 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.
To check file availability, send a GET request to the 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 response is of type object
.