Delete multiple messages

Deletes several email messages in one call. This is the bulk counterpart of DELETE /messages/{id} and the v3 equivalent of the v1 message_delete_list action.

The body selects what to delete, in one of two shapes:

  • {"ids": [1, 2]} deletes the given messages, at most 25 per call.
  • {"deleteFirst": 5} deletes the account's oldest messages that are not already hidden, lowest id first, from 1 to 10 of them.

ids and deleteFirst are mutually exclusive. A message that a campaign uses is hidden instead of deleted, so the campaign keeps its history; a message no campaign uses is deleted together with its files. deleted, hidden and failed report the outcome per message id.

The account must have the Campaigns module, and the API user needs the permission to delete campaigns, which also governs deleting messages.

Body Params

Which messages to delete: an explicit ids list or the deleteFirst oldest ones.

ids
array
length between 1 and 25

Ids of the messages to delete. Positive integers, at most 25 per call; numeric strings are accepted and duplicates are ignored. Send exactly one of ids and deleteFirst; a body with neither, or with both, is rejected with 400.

ids
1 to 10

How many of the account's oldest messages that are not already hidden to delete, lowest id first. An integer from 1 to 10; a numeric string is accepted. Send exactly one of deleteFirst and ids; a body with neither, or with both, is rejected with 400.

Responses

Language
Credentials
Header
URL
LoadingLoading…
Response
Choose an example:
application/json