Skip to content

Prepare a list for download

POST
/optout-list/prepare-download
curl --request POST \
--url https://api.optizmo.com/optout-list/prepare-download \
--header 'Content-Type: application/json' \
--header 'api_key: <api_key>' \
--data '{ "optoutListId": "901fad4c46a1e723", "columns": [ "plain" ], "collectionType": [ "collected" ], "dateRange": { "from": "2021-07-30", "to": "2021-12-13" }, "domainFilter": "gmail.com, co.uk" }'

Starts preparing a list for download and immediately returns a link to where the download will be available.

NOTE The download link will return a 404 NOT FOUND response until the file is ready. The time it takes to prepare the download is not constant and may take up to 10 minutes for it to be available. Continue to poll the download link until it returns the file.

Details of what should be included in the list download file.

Media type application/json
object
optoutListId
required

The Opt-Out list id, which can be found on the Opt-Out list page under Opt-Out List Details

string
Example
901fad4c46a1e723
columns
required

Specifies which columns should appear in the exported file

  • plain - The plain text email or sms opt-out. If this is an MD5 Only list, make sure to also specify hashed otherwise your list may be full of blanks.
  • hashed - An MD5 or SHA512 hash of the plain text email or sms opt-out.
  • timestamp - When the opt-out was received into the system.
  • campaign - Columns for Campaign, Affiliate & Sub-Affiliate names will be added to the output file. Note that this only applies to opt-outs collected through Optizmo, not opt-outs that have been imported.
  • ip - The ip address that submitted an opt-out via an unsubscribe link.
Array<string>
Allowed values: plain hashed timestamp campaign ip
collectionType
required

Specifies which optouts should appear in the download based on how they were collected

  • collected - Optouts that were received via unsubscribe links
  • imported - Optouts that were imported into the system via transfers or file uploads
Array<string>
Allowed values: collected imported
dateRange

Excludes opt-outs that were received outside of the specified date parameters.

object
from

Includes optouts collected + imported on or after this date in format yyyy-MM-dd

string
Example
2021-07-30
to

Includes optouts collected + imported on or before this date in format yyyy-MM-dd

string
Example
2021-12-13
domainFilter

Only include optouts from matching domain names. Enter the last part (root domain) of the domain name(s) you want to restrict optouts to, with multiple domains separated by commas.

string
Example
gmail.com, co.uk

Request to prepare the download has been accepted and is currently underway.

Media type application/json
object
downloadUrl

A url that the download will be available at once prepared. This will return a 404 NOT FOUND response until the file has been produced. Continue to poll this endpoint until the file is available.

Note that processing times depend on list size and will take between a few seconds to several minutes to become available.

string
Example
{
"downloadUrl": "https://temp-storage.optizmo.com/downloads/suppression_list--abc-20210101.zip\""
}

Invalid request payload sent.

Authorization not sent or failed.