Skip to content

Asynchronous message statistics export

exportMessagesStatistics exports message history and statistics to a CSV file on the server, without the row and date-range limits of messages:list. Use it to pull a full account’s message history or any period that the live endpoint’s 100,000-row window can’t page through.

When to use export instead of messages:list

Anchor link to

Use messages:list for live, paginated lookups of a bounded period. Use exportMessagesStatistics when the result would exceed the deep-pagination limit of messages:list (page × per_page > 100000), or when the goal is a single downloadable file rather than paged JSON. The export has no limit on date_range or row count, because it streams the result to a file on disk instead of holding it in one response.

How the export flow works

Anchor link to
  1. Call export with the same filters as messages:list. The response returns a uid task identifier immediately, before the file is generated.
  2. Poll status with that uid until it reports STATUS_SUCCESS (or STATUS_FAILED).
  3. Call result with the same uid to get the generated file name.
  4. Download the file by name.

Use lastTasks to look up recent export tasks for an application, and delete to cancel a task or remove its file early.

exportMessagesStatistics/export

Anchor link to

Queues a message history export and returns a task identifier right away.

POST https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/export

Name
Required
Description
AuthorizationYesServer API token. Must be provided in the following format: Authorization: Api <Server Key>.
Request body parameters
Anchor link to
Name
Required
Type
Description
typeYesStringMust be "TASK_TYPE_EXPORT_MESSAGES_V2".
export_messages_v2YesObjectExport parameters, described below.
export_messages_v2.application_codeSee noteStringPushwoosh application code. Required if app_group_code is not set.
export_messages_v2.app_group_codeSee noteStringApplication group code, exports across every app in the group. Required if application_code is not set.
export_messages_v2.searchNoStringFree-text search over message title and content.
export_messages_v2.filtersNoObjectMessage filters, described below. Omit to export the whole account history.
export_messages_v2.propertiesNoArrayColumns to include in the CSV, described below.

export_messages_v2.filters accepts:

Name
TypeDescription
statusesArrayMessage statuses to include. Possible values: "MESSAGE_STATUS_CANCELED", "MESSAGE_STATUS_CREATING", "MESSAGE_STATUS_DONE", "MESSAGE_STATUS_FAIL", "MESSAGE_STATUS_PENDING", "MESSAGE_STATUS_PROCESSING", "MESSAGE_STATUS_WAITING".
platformsArrayPlatform codes (numeric, e.g. 1 for iOS), not the platform name strings used by messages:list.
sent_dateObjectReporting period filtered on send date: {"date_from": "YYYY-MM-DD", "date_to": "YYYY-MM-DD"}.
created_dateObjectReporting period filtered on message creation date, same format as sent_date.
created_viaArrayMessage source. Possible values: "AB_TEST", "API", "AUTO_PUSH", "CP", "CSV", "CUSTOMER_JOURNEY", "EMAIL_API", "EMAIL_CP", "GEO_ZONE", "PUSH_ON_EVENT", "RSS", "SYSTEM".
segmentsArrayFilter codes the message was sent to.
campaignsArrayCampaign codes. Unlike messages:list, this takes a list, not a single code.
message_idString (uint64)A single numeric message ID, quoted. Unlike messages:list, export takes one ID, not an array.
message_codeStringA single message code.

export_messages_v2.properties selects which columns the CSV contains. Possible values: "EXPORT_MESSAGE_PROPERTY_ID", "EXPORT_MESSAGE_PROPERTY_TIMESTAMP", "EXPORT_MESSAGE_PROPERTY_CONTENT", "EXPORT_MESSAGE_PROPERTY_TITLE", "EXPORT_MESSAGE_PROPERTY_APPLICATIONS", "EXPORT_MESSAGE_PROPERTY_STATUS", "EXPORT_MESSAGE_PROPERTY_PLATFORMS", "EXPORT_MESSAGE_PROPERTY_SOURCE", "EXPORT_MESSAGE_PROPERTY_FILTER", "EXPORT_MESSAGE_PROPERTY_SUBSCRIPTION_SEGMENTS", "EXPORT_MESSAGE_PROPERTY_SENT", "EXPORT_MESSAGE_PROPERTY_OPENED", "EXPORT_MESSAGE_PROPERTY_ERRORS", "EXPORT_MESSAGE_PROPERTY_RECIPIENTS", "EXPORT_MESSAGE_PROPERTY_DELIVERED", "EXPORT_MESSAGE_PROPERTY_TOTAL_DELIVERED", "EXPORT_MESSAGE_PROPERTY_TOTAL_OPENED", "EXPORT_MESSAGE_PROPERTY_TOTAL_CLICKS", "EXPORT_MESSAGE_PROPERTY_CLICKS", "EXPORT_MESSAGE_PROPERTY_UNSUBSCRIBED".

Example request
Anchor link to
{
"type": "TASK_TYPE_EXPORT_MESSAGES_V2",
"export_messages_v2": {
"application_code": "XXXXX-XXXXX",
"filters": {
"created_date": {
"date_from": "2026-01-01",
"date_to": "2026-06-30"
},
"statuses": ["MESSAGE_STATUS_DONE"],
"platforms": [1, 3]
},
"properties": [
"EXPORT_MESSAGE_PROPERTY_ID",
"EXPORT_MESSAGE_PROPERTY_TIMESTAMP",
"EXPORT_MESSAGE_PROPERTY_STATUS",
"EXPORT_MESSAGE_PROPERTY_PLATFORMS",
"EXPORT_MESSAGE_PROPERTY_SENT",
"EXPORT_MESSAGE_PROPERTY_OPENED"
]
}
}
{
"uid": "177458"
}

exportMessagesStatistics/status

Anchor link to

Returns the progress of an export task.

POST https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/status

Request body parameters
Anchor link to
NameRequiredTypeDescription
uidYesString (int64)Task identifier from the export response, e.g. "177458".
Example request
Anchor link to
{
"uid": "177458"
}
{
"status": "STATUS_SUCCESS",
"progress": 1
}

status is one of "STATUS_PENDING", "STATUS_SUCCESS", or "STATUS_FAILED". progress is a fraction between 0 and 1; poll status until it reaches "STATUS_SUCCESS" before calling result.

exportMessagesStatistics/result

Anchor link to

Returns the generated file name once the task has completed.

POST https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/result

Request body parameters
Anchor link to
NameRequiredTypeDescription
uidYesString (int64)Task identifier from the export response, e.g. "177458".
Example request
Anchor link to
{
"uid": "177458"
}
{
"export_messages_v2_result": {
"file": "Export_Messages_v2_12345_20260813120000-a1b2c3d4.csv"
}
}

Calling result before status reports "STATUS_SUCCESS" returns an empty result. Pass the file value as-is to the download endpoint.

exportMessagesStatistics/lastTasks

Anchor link to

Lists recent export tasks for an application, most recent first.

POST https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/lastTasks

Request body parameters
Anchor link to
NameRequiredTypeDescription
applicationNoStringPushwoosh application code. Omit to list tasks across all applications the token has access to.
typesNoArrayRestrict to specific task types. Use ["TASK_TYPE_EXPORT_MESSAGES_V2"] to only see message exports.
campaignNoStringFilter by campaign code.
message_idNoString (uint64)Filter by a single numeric message ID, quoted.
message_codeNoStringFilter by a single message code.
limitNoIntegerMaximum number of tasks to return.
timestamp_fromNoStringOnly return tasks created after this timestamp (RFC 3339).
Example request
Anchor link to
{
"application": "XXXXX-XXXXX",
"types": ["TASK_TYPE_EXPORT_MESSAGES_V2"],
"limit": 10
}
{
"tasks": [
{
"id": "177458",
"timestamp": "2026-08-13T12:00:00Z",
"status": "STATUS_SUCCESS",
"requested_by_user": "user@example.com",
"export_messages_v2": {
"application_code": "XXXXX-XXXXX"
},
"export_messages_v2_result": {
"file": "Export_Messages_v2_12345_20260813120000-a1b2c3d4.csv"
}
}
]
}

exportMessagesStatistics/delete

Anchor link to

Deletes a task and its file before the 7-day retention window expires.

POST https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/delete

Request body parameters
Anchor link to
NameRequiredTypeDescription
uidYesString (int64)Task identifier from the export response, e.g. "177458".
Example request
Anchor link to
{
"uid": "177458"
}
{}

Downloading the exported file

Anchor link to

GET https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/download/<file>

Name
Required
Description
AuthorizationYesServer API token, in the same format as the other exportMessagesStatistics methods: Authorization: Api <Server Key> (the Api scheme is case-insensitive). A request with no Authorization header and no logged-in Control Panel session gets 401 Unauthorized.

Replace <file> with the exact file value from the result response, for example:

https://api.pushwoosh.com/api/v2/statistics/exportMessagesStatistics/download/Export_Messages_v2_12345_20260813120000-a1b2c3d4.csv

The file is a CSV containing the columns selected in properties. It stays available for 7 days after the export finishes, then the cleanup job removes it and the URL stops resolving.