Export sent messages as CSVMenu

Export sent messages as CSV

POST/v1/messages/exports

Requires an API key with the messages:read scope. About keys and scopes

Works with integration, agent and partner keys.

A repeat without a key does it again; send Idempotency-Key and a retry within 24 hours replays the first response. About idempotency

Queues a CSV of the message log. The body takes the filters of GET /v1/messages (status, channel, recipient, query, messageType, campaignId, journeyId, stepId, templateId, correlationId, createdAfter, createdBefore; not opened or clicked) 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.

Header parameters

Kirora-Workspacestringoptional

Partner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.

pattern ^[A-Za-z0-9._:-]{1,128}$

Idempotency-Keystringoptional

Makes a retry safe: a repeat with the same key and body within 24 hours gets the first response again, with Idempotency-Replay: true. The same key with another request is 409 IDEMPOTENCY_KEY_REUSED; while the first is still running, 409 IDEMPOTENCY_KEY_IN_USE; after an unsafe first request failed or never returned, 409 IDEMPOTENCY_KEY_OUTCOME_UNKNOWN. Use a new key, such as a UUID, for each new request.

8–255 characters

Request body

statusstringoptional

Only messages in this status.

one of queued, sending, skipped, sent, failed, delivered, bounced, complained

channelstringoptional

Only messages on this channel.

one of email, push

recipientstringoptional

The exact address the message went to.

querystringoptional

Part of the recipient's email address or name, matched against the contact the message went to.

1–100 characters

messageTypestringoptional

Only messages of this type: marketing or transactional.

one of marketing, transactional

campaignIdstringoptional

Only messages from this campaign.

uuid

journeyIdstringoptional

Only messages from this journey.

uuid

stepIdstringoptional

With journeyId, only messages from the journey's step with this id, in every version of its steps.

pattern ^[a-z0-9][a-z0-9_-]{0,63}$

templateIdstringoptional

Only transactional sends from this stored template; no other message records one.

uuid

correlationIdstringoptional

Only the transactional sends that carried this correlationId.

1–255 characters

createdAfterstringoptional

Only messages accepted at or after this time (inclusive).

date-time

createdBeforestringoptional

Only messages accepted before this time (exclusive).

date-time

countedAfterstringoptional

Only messages the send reports count at or after this time (inclusive): when each was sent, or accepted if it never was. With a report's resolved from and to, lists the messages behind its send counts (the overview, the comparisons, campaign, journey and step metrics, the transactional report). Not the campaign series, which counts each outcome when it happened.

date-time

countedBeforestringoptional

Only messages the send reports count before this time (exclusive), in the same sense.

date-time

Returns

Returns 202 Accepted with a MessageExport in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.

  • 202 AcceptedThe export, queued.
  • 409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.
  • 413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).
  • 415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
idstringrequired

uuid

statusstringrequired

queued, generating, then ready or failed; expired once the file is deleted.

one of queued, generating, ready, failed, expired

rowCountinteger | nullrequired

Rows in the file, once it is ready.

filtersMessageExportFiltersrequired

The filters the export was created with.

14 child attributes
statusstringoptional

Only messages in this status.

one of queued, sending, skipped, sent, failed, delivered, bounced, complained

channelstringoptional

Only messages on this channel.

one of email, push

recipientstringoptional

The exact address the message went to.

email · up to 320 characters

querystringoptional

Part of the recipient's email address or name, matched against the contact the message went to.

1–100 characters

messageTypestringoptional

Only messages of this type: marketing or transactional.

one of marketing, transactional

campaignIdstringoptional

Only messages from this campaign.

uuid

journeyIdstringoptional

Only messages from this journey.

uuid

stepIdstringoptional

With journeyId, only messages from the journey's step with this id, in every version of its steps.

pattern ^[a-z0-9][a-z0-9_-]{0,63}$

templateIdstringoptional

Only transactional sends from this stored template; no other message records one.

uuid

correlationIdstringoptional

Only the transactional sends that carried this correlationId.

1–255 characters

createdAfterstringoptional

Only messages accepted at or after this time (inclusive).

date-time

createdBeforestringoptional

Only messages accepted before this time (exclusive).

date-time

countedAfterstringoptional

Only messages the send reports count at or after this time (inclusive): when each was sent, or accepted if it never was. With a report's resolved from and to, lists the messages behind its send counts (the overview, the comparisons, campaign, journey and step metrics, the transactional report). Not the campaign series, which counts each outcome when it happened.

date-time

countedBeforestringoptional

Only messages the send reports count before this time (exclusive), in the same sense.

date-time

createdAtstringrequired

date-time

completedAtstring | nullrequired

date-time

expiresAtstring | nullrequired

When the file is deleted; the export then reads expired.

date-time

failureCodestring | nullrequired

EXPORT_TOO_LARGE or GENERATION_FAILED when status is failed.

Headers on 202 Accepted

Idempotency-Replaystringoptional

true when this is the stored response to an earlier request with the same key.

one of true