Node.js
import { MailChannels } from "mailchannels-sdk";
const { MAILCHANNELS_API_KEY } = process.env;
if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");
const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);
const { success, error } = await mailchannels.webhooks.deleteAll();
if (!success) {
console.error("Delete webhooks failed:", error);
process.exit(1);
}
console.log("All webhooks deleted");import os
import sys
import mailchannels
if not os.environ.get("MAILCHANNELS_API_KEY"):
sys.exit("Set MAILCHANNELS_API_KEY before running")
# Delete all webhook endpoints enrolled for the account.
response = mailchannels.Webhooks.delete_all()
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");
$client = new Client(apiKey: $api_key);
// Delete all webhook endpoints enrolled for the account.
$response = $client->webhooks->deleteAll();
print_r($response->toArray());curl --request DELETE \
--url https://api.mailchannels.net/tx/v1/webhook \
--header 'X-Api-Key: <x-api-key>'Delete Customer Webhooks
Deletes all registered webhook endpoints for the customer.
DELETE
/
webhook
Node.js
import { MailChannels } from "mailchannels-sdk";
const { MAILCHANNELS_API_KEY } = process.env;
if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");
const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);
const { success, error } = await mailchannels.webhooks.deleteAll();
if (!success) {
console.error("Delete webhooks failed:", error);
process.exit(1);
}
console.log("All webhooks deleted");import os
import sys
import mailchannels
if not os.environ.get("MAILCHANNELS_API_KEY"):
sys.exit("Set MAILCHANNELS_API_KEY before running")
# Delete all webhook endpoints enrolled for the account.
response = mailchannels.Webhooks.delete_all()
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");
$client = new Client(apiKey: $api_key);
// Delete all webhook endpoints enrolled for the account.
$response = $client->webhooks->deleteAll();
print_r($response->toArray());curl --request DELETE \
--url https://api.mailchannels.net/tx/v1/webhook \
--header 'X-Api-Key: <x-api-key>'Headers
Response
Successfully removed webhook endpoint(s)
Was this page helpful?
⌘I

