API Call Name:

v2 Add Blacklist Monitor

API Call:

https://api.hetrixtools.com/v2/<API_TOKEN>/blacklist/add/

POST Variables:
target – the IP address (i.e., 1.2.3.4), or IP range (i.e., 1.2.3.4 – 1.2.3.7), or IP block (i.e., 1.2.3.4/28), or domain name (i.e., mydomain.com)
label – the label for the added monitor(s)
contact – the contact list ID for the added monitor(s). You can fetch your contact list IDs by using the API Call ‘v1 List Contact Lists’

cURL Example:

curl -X POST "https://api.hetrixtools.com/v2/YOURKEY/blacklist/add/" \
--data-urlencode "target=" \
--data-urlencode "label=" \
--data-urlencode "contact="

PHP Example:

<?php
$api_key = 'YOURKEY'; // Replace with your API Key

$target = ''; // Fill in the target you wish to add
$label = ''; // Optionally add a label for this monitor
$contact = ''; // Fill in the contact list id

$url = 'https://api.hetrixtools.com/v2/'.$api_key.'/blacklist/add/';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(["target" => $target, "label" => $label, "contact" => $contact]));
$result = curl_exec($curl);
?>

Using this API Call, you can easily add one or more blacklist monitors at once to your account, and it will consume one (1) API Call from your monthly quota, regardless of how many IPs you add at once.

You can test out the API Call in our API Explorer:
https://hetrixtools.com/dashboard/api-explorer/

screenshot_1

Monitors are added instantly and start checking right away, just like when you add them via our dashboard interface.

screenshot_2