Node.js
import { MailChannels } from "mailchannels-sdk";
const { MAILCHANNELS_API_KEY, RECIPIENT } = process.env;
if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");
if (!RECIPIENT) throw new Error("Set RECIPIENT to the email address whose suppression entry should be removed");
const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);
const { success, error } = await mailchannels.suppressions.delete(RECIPIENT);
if (!success) {
console.error("Delete suppression failed:", error);
process.exit(1);
}
console.log("Suppression deleted");import os
import sys
import mailchannels
if not os.environ.get("MAILCHANNELS_API_KEY"):
sys.exit("Set MAILCHANNELS_API_KEY (parent or sub-account) before running")
recipient = os.environ.get("RECIPIENT")
if not recipient:
sys.exit("Set RECIPIENT to the email address whose suppression entry should be removed")
# SOURCE is optional. Defaults to "api". Pass "all" to delete every entry for the recipient.
source = os.environ.get("SOURCE")
response = mailchannels.Suppressions.delete(recipient, source=source)
print(response)<?php
require_once __DIR__ . '/vendor/autoload.php';
use MailChannels\Client;
$api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error: MAILCHANNELS_API_KEY is not set\n");
$recipient = getenv('RECIPIENT') or exit("Error: RECIPIENT is not set\n");
$client = new Client(apiKey: $api_key);
// SOURCE is optional. Defaults to "api". Pass "all" to delete every entry for the recipient.
$source = getenv('SOURCE') ?: null;
$response = $client->suppressions->delete($recipient, $source);
print_r($response->toArray());curl --request DELETE \
--url https://api.mailchannels.net/tx/v1/suppression-list/recipients/{recipient} \
--header 'X-Api-Key: <x-api-key>'{
"errors": [
"<string>"
]
}Delete Suppression Entry
Deletes suppression entry associated with the account based on the specified recipient and source. If source is not provided, it defaults to ‘api’. If source is set to ‘all’, all suppression entries related to the specified recipient will be deleted.
DELETE
/
suppression-list
/
recipients
/
{recipient}
Node.js
import { MailChannels } from "mailchannels-sdk";
const { MAILCHANNELS_API_KEY, RECIPIENT } = process.env;
if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");
if (!RECIPIENT) throw new Error("Set RECIPIENT to the email address whose suppression entry should be removed");
const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);
const { success, error } = await mailchannels.suppressions.delete(RECIPIENT);
if (!success) {
console.error("Delete suppression failed:", error);
process.exit(1);
}
console.log("Suppression deleted");import os
import sys
import mailchannels
if not os.environ.get("MAILCHANNELS_API_KEY"):
sys.exit("Set MAILCHANNELS_API_KEY (parent or sub-account) before running")
recipient = os.environ.get("RECIPIENT")
if not recipient:
sys.exit("Set RECIPIENT to the email address whose suppression entry should be removed")
# SOURCE is optional. Defaults to "api". Pass "all" to delete every entry for the recipient.
source = os.environ.get("SOURCE")
response = mailchannels.Suppressions.delete(recipient, source=source)
print(response)<?php
require_once __DIR__ . '/vendor/autoload.php';
use MailChannels\Client;
$api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error: MAILCHANNELS_API_KEY is not set\n");
$recipient = getenv('RECIPIENT') or exit("Error: RECIPIENT is not set\n");
$client = new Client(apiKey: $api_key);
// SOURCE is optional. Defaults to "api". Pass "all" to delete every entry for the recipient.
$source = getenv('SOURCE') ?: null;
$response = $client->suppressions->delete($recipient, $source);
print_r($response->toArray());curl --request DELETE \
--url https://api.mailchannels.net/tx/v1/suppression-list/recipients/{recipient} \
--header 'X-Api-Key: <x-api-key>'{
"errors": [
"<string>"
]
}Was this page helpful?
⌘I

