Get alert counts
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
end_date: '<string>',
sender_id: '<string>',
start_date: '<string>',
sub_account_filter: '<string>'
})
};
fetch('https://api.mailchannels.net/outbound/v1/alertcount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/outbound/v1/alertcount"
payload = {
"end_date": "<string>",
"sender_id": "<string>",
"start_date": "<string>",
"sub_account_filter": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailchannels.net/outbound/v1/alertcount",
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([
'end_date' => '<string>',
'sender_id' => '<string>',
'start_date' => '<string>',
'sub_account_filter' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://api.mailchannels.net/outbound/v1/alertcount \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"end_date": "<string>",
"sender_id": "<string>",
"start_date": "<string>",
"sub_account_filter": "<string>"
}
'{}{
"code": 123,
"errors": [
"<string>"
],
"message": "<string>"
}{
"code": 123,
"errors": [
"<string>"
],
"message": "<string>"
}Get alert counts
Returns alert counts grouped by hour, day, or week.
POST
/
alertcount
Get alert counts
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
end_date: '<string>',
sender_id: '<string>',
start_date: '<string>',
sub_account_filter: '<string>'
})
};
fetch('https://api.mailchannels.net/outbound/v1/alertcount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/outbound/v1/alertcount"
payload = {
"end_date": "<string>",
"sender_id": "<string>",
"start_date": "<string>",
"sub_account_filter": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailchannels.net/outbound/v1/alertcount",
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([
'end_date' => '<string>',
'sender_id' => '<string>',
'start_date' => '<string>',
'sub_account_filter' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://api.mailchannels.net/outbound/v1/alertcount \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"end_date": "<string>",
"sender_id": "<string>",
"start_date": "<string>",
"sub_account_filter": "<string>"
}
'{}{
"code": 123,
"errors": [
"<string>"
],
"message": "<string>"
}{
"code": 123,
"errors": [
"<string>"
],
"message": "<string>"
}Authorizations
Body
application/json
The end of the date range, including the UTC offset, for example 2026-09-02T00:00:00-0700.
The ID of the sender.
The start of the date range, including the UTC offset, for example 2026-09-01T00:00:00-0700.
The time interval used to group alert counts. Defaults to days.
Available options:
days, hours, weeks Filter for sub-accounts.
Response
A JSON object mapping timestamps to alert counts.
Was this page helpful?

