Save Monitor Alert
curl --request POST \
--url https://api.campaigncleaner.com/v1/monitor_save_alert \
--header 'Content-Type: application/json' \
--data '
{
"kind": "spam",
"domain_id": 12,
"provider_key": "gmail.com",
"delivery": "instant",
"recipients": [
"ops@example.com"
],
"enabled": true
}
'import requests
url = "https://api.campaigncleaner.com/v1/monitor_save_alert"
payload = {
"kind": "spam",
"domain_id": 12,
"provider_key": "gmail.com",
"delivery": "instant",
"recipients": ["ops@example.com"],
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
kind: 'spam',
domain_id: 12,
provider_key: 'gmail.com',
delivery: 'instant',
recipients: ['ops@example.com'],
enabled: true
})
};
fetch('https://api.campaigncleaner.com/v1/monitor_save_alert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.campaigncleaner.com/v1/monitor_save_alert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kind' => 'spam',
'domain_id' => 12,
'provider_key' => 'gmail.com',
'delivery' => 'instant',
'recipients' => [
'ops@example.com'
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.campaigncleaner.com/v1/monitor_save_alert"
payload := strings.NewReader("{\n \"kind\": \"spam\",\n \"domain_id\": 12,\n \"provider_key\": \"gmail.com\",\n \"delivery\": \"instant\",\n \"recipients\": [\n \"ops@example.com\"\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.campaigncleaner.com/v1/monitor_save_alert")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"spam\",\n \"domain_id\": 12,\n \"provider_key\": \"gmail.com\",\n \"delivery\": \"instant\",\n \"recipients\": [\n \"ops@example.com\"\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.campaigncleaner.com/v1/monitor_save_alert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"spam\",\n \"domain_id\": 12,\n \"provider_key\": \"gmail.com\",\n \"delivery\": \"instant\",\n \"recipients\": [\n \"ops@example.com\"\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"alert_id": 4,
"kind": "spam",
"description": "Mail from example.com at Gmail lands in spam",
"domain_id": 12,
"domain": "example.com",
"provider_key": "gmail.com",
"provider": "Gmail",
"threshold": null,
"min_messages": null,
"delivery": "instant",
"recipients": [
{
"email": "ops@example.com",
"receiving": true
}
],
"enabled": true
}
}Inbox Placement Monitor
Save Monitor Alert
The monitor_save_alert API creates an alert (no alert_id, returns 201) or replaces an existing one (alert_id, returns 200).
Alerts can only go to the account owner, your team members, or an address at one of your verified domains (monitored or alert domains). To alert someone else, invite them to your team first.
Requires an active plan that includes Inbox Placement Monitor and a role other than User.
Header:
X-CC-API-Key: Your API Key
Request Body:
Required:
- kind: spam (lands in spam), notinbox (spam, Gmail tabs or Outlook’s Other folder), rate (inbox rate drops below threshold) or auth (SPF, DKIM or DMARC fails). Optional:
- alert_id: To update an existing alert.
- domain_id: One monitored domain; leave out or 0 for all.
- provider_key: One provider; leave out for all.
- threshold: rate only: inbox rate in % (1-100, default 80).
- min_messages: rate only: minimum messages in 24 hours before it can trigger (1-1000, default 5).
- delivery: instant or digest (once a day).
- recipients: Array or comma separated string, up to 5. Empty sends to the account owner.
- enabled: (true/false).
Response:
- alert: The saved alert, as in monitor_get_alerts.
POST
/
v1
/
monitor_save_alert
Save Monitor Alert
curl --request POST \
--url https://api.campaigncleaner.com/v1/monitor_save_alert \
--header 'Content-Type: application/json' \
--data '
{
"kind": "spam",
"domain_id": 12,
"provider_key": "gmail.com",
"delivery": "instant",
"recipients": [
"ops@example.com"
],
"enabled": true
}
'import requests
url = "https://api.campaigncleaner.com/v1/monitor_save_alert"
payload = {
"kind": "spam",
"domain_id": 12,
"provider_key": "gmail.com",
"delivery": "instant",
"recipients": ["ops@example.com"],
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
kind: 'spam',
domain_id: 12,
provider_key: 'gmail.com',
delivery: 'instant',
recipients: ['ops@example.com'],
enabled: true
})
};
fetch('https://api.campaigncleaner.com/v1/monitor_save_alert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.campaigncleaner.com/v1/monitor_save_alert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kind' => 'spam',
'domain_id' => 12,
'provider_key' => 'gmail.com',
'delivery' => 'instant',
'recipients' => [
'ops@example.com'
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.campaigncleaner.com/v1/monitor_save_alert"
payload := strings.NewReader("{\n \"kind\": \"spam\",\n \"domain_id\": 12,\n \"provider_key\": \"gmail.com\",\n \"delivery\": \"instant\",\n \"recipients\": [\n \"ops@example.com\"\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.campaigncleaner.com/v1/monitor_save_alert")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"spam\",\n \"domain_id\": 12,\n \"provider_key\": \"gmail.com\",\n \"delivery\": \"instant\",\n \"recipients\": [\n \"ops@example.com\"\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.campaigncleaner.com/v1/monitor_save_alert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"spam\",\n \"domain_id\": 12,\n \"provider_key\": \"gmail.com\",\n \"delivery\": \"instant\",\n \"recipients\": [\n \"ops@example.com\"\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"alert_id": 4,
"kind": "spam",
"description": "Mail from example.com at Gmail lands in spam",
"domain_id": 12,
"domain": "example.com",
"provider_key": "gmail.com",
"provider": "Gmail",
"threshold": null,
"min_messages": null,
"delivery": "instant",
"recipients": [
{
"email": "ops@example.com",
"receiving": true
}
],
"enabled": true
}
}
