Export send history as CSV
POST/api/partner-gateway/messages/history/export
Queues a CSV export of the messages sent through the API in a date range, with every channel in one file.
- API sends only: the messages sent from campaigns or from the web console are not included.
- Body:
startDateTimeandendDateTimeas ISO-8601 date-times with an offset, such as2025-01-01T00:00:00+01:00.senderandrecipientare optional filters. - The answer is
202: the job is queued, not completed. It can take from a few seconds to several minutes, depending on the volume of the date range. - Get the file: poll
GET /exports. The export is listed there once its file is ready; an export that is still running, or that failed, is not listed. - Large ranges are slow: months of data can take long. If you need a subset, narrow the range or page through
GET /messages/history.
On RCS and WhatsApp the status columns do not follow
deliveryStatus. They only say whether a delivery date was recorded:3,Delivered, when one was, otherwise1,Sent. A failed message readsSent, and an RCS message that the status API reports asUNSUPPORTEDorEXPIRED, or a WhatsApp one reported asUNKNOWN, can readDelivered.
Columns of the CSV file
In this order:
- Row number.
- DateTime: the send date.
- Originator: the SMS sender or the WhatsApp phone number, empty for RCS.
- Destination: with its last three characters replaced by
***, on every channel. - Delivery status: the numeric code that
Delivery resultspells out. - IP address.
- ID SubAccount: the API user that sent the message.
- SMS cost: the unit price, on every channel.
- Customer ID: the
messageIdgiven at send time, or the identifier generated when none was given. - Sent type:
SMS-API,RCS-APIorWHATSAPP-API. - Part number.
- Total parts.
- Delivery result:
Sent,Rejected,Delivered,Expired,DeletedorUndeliverable.
An SMS too long for a single part has one row per part. The file has no delivery-date column and does not contain the message text.
Request
Responses
- 202
- 400
- 401
- 500
Export queued. No response body.
The body is missing or malformed, startDateTime or endDateTime is missing, or startDateTime is later than endDateTime. Nothing is queued.
The API key is missing, invalid, or lacks the MESSAGES operation.
Unexpected server error. Retry after a short delay.