Upload and Create a Suppression List

This functions allows you to upload a csv file to create a suppression list is achieved through a multipart/form-data upload.

Parameters:

NameRequired/OptionalValuesDescription
listRequiredA csv file that contains at least one of the following suppressible field types: email, phone, or domain.
has_headerRequired1 or 0A boolean indicating whether the uploaded csv file contains a header in the first row.
header_mapOptionalA JSON object that contains mapping of column indexes in the csv file to suppressible fields.See below for details.

The header_map parameter

If passed, the structure of the header_map parameter must be a JSON object, with one or more of the following keys: email, phone, domain.

The value for each entry is an array of integers, denoting which column in the uploaded csv file contains those values.

For example, if the csv file contained emails in the first and second columns, and phone numbers in the third column, the header_map would look like:

{
  "email": [
    0,
    1
  ],
  "phone": [
    2
  ]
}

As an alternative, to passing the header_map parameter, you can modify the header of the csv file, so that it contains the recognizable suppression field names: email, phone, domain.

For example, this would be a valid csv file to upload:

first,last,email,email
bob,rogers,[email protected],[email protected]
julie,smith,[email protected],[email protected]

The above csv would be equivalent to passing the following header_map parameter:

{
  "email": [
    2,
    3
  ]
}

Example Response

{
    "versium": {
        "version": "2.0",
        "query_id": "ba4298ae82760126d8f9fa62e4d4e82d",
        "query_time": 0.19606900215148926,
        "results": {
            "id": 51,
            "guid": "1361f1bd-713b-4571-9a7a-1e93b140989a",
            "name": "Consumer5-41.csv",
            "status": 4,
            "records": 6,
            "meta_data": {
                "errors": 0,
                "field_counts": {
                    "Phone": 0,
                    "Domain": 0,
                    "EmailAddr": 5
                },
                "callback_url": ""
            },
            "created_at": "2024-01-24T20:01:07.000000Z",
            "deleted_at": null,
            "header_map": {
                "email": [
                    0
                ]
            },
            "has_header": true
        }
    }
}