Create suppression list

Purpose

This API allows you to add email addresses to the suppression list to prevent further email sending to them.

Request URL

Method : POST

https://api.zeptomail.com/v1.1/suppressions/{type}

OAuth scope

The steps to generate and use OAuth token can be found here.

scope=Zeptomail.Suppressions.All

or

scope=Zeptomail.Suppressions.CREATE

ALL - This will give the basic CRUD access too all the suppression APIs.

Steps to generate the Mail Agent key

Select the Mail Agent that you want to connect to your application.

  1. Navigate to the SMTP/API tab. Go to the API section.
  2. Copy the Mail Agent alias from this section. 

    Mail Agents >> SMTP/API >> Copy the Mail Agent alias

Path parameters

ParameterTypeDescription
typeEmail address or DomainThe domain or email address that should be suppressed.

Request body

ParameterTypeDescription
action*StringType of suppression to be performed—reject, suppress or suppress_tracking.
mailagent_keysArrayThe Mail Agent alias value.
descriptionStringReason for the suppression.
values*ArrayJSON array of the email address or domain, whichever is applicable.

*-Mandatory parameter

 

Failure response code

ValueErrorSolution
DND_101Suppression data already existsCross-verify if the domain or email address is present in the suppression list before adding it.   

 

Sample request

Copied{
    "suppression_type":"email",
    "action":"suppress",
    "values":["rebecca@zilker.com"],
    "description":"Suppress the email address",
    "mailagent_keys":["4e29626b34b4a653"]
}

Sample response

Copied{
    "data": {
        "modified_time": "03 Jan 2025 10:31 PM",
        "suppression_type": "email",
        "values": [
            "rebecca@zilker.com"
        ],
        "action": "suppress",
        "description": "Suppress the email address",
        "mailagent_keys": [
            "4e29626b34b4a653"
        ],
        "category": "manual"
    },
    "status": "success"
}

Sample Failure response

Copied{
    "error": {
        "code": "DND_101",
        "field": "values",
        "message": "Suppression data already exist",
        "value": "[rebecca@zilker.com]"
    },
    "status": "failure"
}