Messages
Export sent messages as CSV
POST/v1/messages/exports
Requires an API key with the messages:read scope. About keys and scopes
Queues a CSV of the send log. The body takes the filters of GET /v1/messages/deliveries (status, channel, recipient, messageType, createdAfter, createdBefore) and applies them the same way; send {} for every message. A filter matching no message is refused with NOTHING_TO_EXPORT. The file is generated in the background: poll the export until status is ready, then download it. Any key of the workspace with messages:read can read the export.
Request body
statusstringoptionalOnly messages in this status.
one of
queued,sending,skipped,sent,failed,delivered,bounced,complainedchannelstringoptionalOnly messages on this channel.
one of
email,pushrecipientstringoptionalThe exact address the message went to.
qstringoptionalPart of the recipient's email address or name, matched against the contact the message went to.
1–100 characters
messageTypestringoptionalOnly messages of this type, such as campaign or transactional.
one of
marketing,transactionalcreatedAfterstringoptionalOnly messages accepted at or after this time (inclusive).
date-time
createdBeforestringoptionalOnly messages accepted before this time (exclusive).
date-time
Returns
Returns 202 Accepted with a MessageExport in data. Otherwise returns an error; Errors lists every code and which to retry.
idstringrequireduuid
statusstringrequiredqueued,generating, thenreadyorfailed;expiredonce the file is deleted.one of
queued,generating,ready,failed,expiredrowCountinteger | nullrequiredRows in the file, once it is ready.
min -9007199254740991 · max 9007199254740991
filtersMessageExportFiltersrequiredThe filters the export was created with.
7 child attributes
statusstringoptionalOnly messages in this status.
one of
queued,sending,skipped,sent,failed,delivered,bounced,complainedchannelstringoptionalOnly messages on this channel.
one of
email,pushrecipientstringoptionalThe exact address the message went to.
email · up to 320 characters
qstringoptionalPart of the recipient's email address or name, matched against the contact the message went to.
1–100 characters
messageTypestringoptionalOnly messages of this type, such as campaign or transactional.
one of
marketing,transactionalcreatedAfterstringoptionalOnly messages accepted at or after this time (inclusive).
date-time
createdBeforestringoptionalOnly messages accepted before this time (exclusive).
date-time
createdAtstringrequireddate-time
completedAtstring | nullrequireddate-time
expiresAtstring | nullrequiredWhen the file is deleted; the export then reads
expired.date-time
failureCodestring | nullrequiredEXPORT_TOO_LARGEorGENERATION_FAILEDwhenstatusisfailed.