ZapSMTP / Docs / StatisticsResponse
Metrics by domain, stream, tag or provider
GET/v1/metrics
Delivery and engagement of live mail by sending domain, stream, tag or mailbox provider, with rates and a time series.
Requires a full-access key.
Counts are recipients, except delayed, opened and clicked: unique emails. Delivery and bounce rates are of sent; complaint, open and click rates of delivered. Test-mode mail is excluded. Kept for 400 days.
An out-of-band bounce (a later bounce email from the remote server) has no sending domain: it is grouped under an empty value.
Totals and the series count each email once whatever the dimension; with dimension=tag an email with several tags appears in each of its tags' groups.
Query parameters
fromstring- RFC 3339 start. At most 400 days before
to. Default7 days ago. tostring- RFC 3339 end (exclusive). Default
now. granularitystringhour(ranges up to 31 days) ordayforseries. Defaulthour up to 48 hours, else day.dimensionstringdomain,stream,tagorprovider: addsgroups, one row per value, busiest first.domainstring- Only this sending (From) domain.
streamstringtransactionalorbroadcast.providerstring- Gmail, Microsoft, Yahoo, Apple or Other.
tagstring- Only emails with this tag, as
name=value. Cannot be combined with domain, stream or provider, and groups only bytag.
Errors
restricted_api_keyHTTP 403invalid_parameterHTTP 422- Bad time, range, granularity or dimension, or a tag combined with another filter.
curl 'https://zapsmtp.xyz/v1/metrics?dimension=domain' \
-H "Authorization: Bearer $ZAP_API_KEY"const res = await fetch('https://zapsmtp.xyz/v1/metrics?dimension=domain', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.ZAP_API_KEY}`,
},
});
// 204 No Content (e.g. a delete) has no body
const data = res.status === 204 ? null : await res.json();
if (!res.ok) throw new Error(`${data.name}: ${data.message}`);
console.log(data);import os
import requests
res = requests.get(
"https://zapsmtp.xyz/v1/metrics?dimension=domain",
headers={"Authorization": f"Bearer {os.environ['ZAP_API_KEY']}"},
timeout=30,
)
res.raise_for_status()
print(res.json() if res.status_code != 204 else "deleted")<?php
$ch = curl_init('https://zapsmtp.xyz/v1/metrics?dimension=domain');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZAP_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException($data['message']);
}
print_r($data);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(
"GET",
"https://zapsmtp.xyz/v1/metrics?dimension=domain",
nil,
)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ZAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}require 'net/http'
require 'json'
uri = URI('https://zapsmtp.xyz/v1/metrics?dimension=domain')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV.fetch('ZAP_API_KEY')}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, (JSON.parse(res.body) unless res.body.to_s.empty?)import java.net.URI;
import java.net.http.*;
public class ZapRequest {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder(URI.create("https://zapsmtp.xyz/v1/metrics?dimension=domain"))
.header("Authorization", "Bearer " + System.getenv("ZAP_API_KEY"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://zapsmtp.xyz/v1/metrics?dimension=domain");
request.Headers.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ZAP_API_KEY"));
var response = await http.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");Set
ZAP_API_KEY in your environment.Response 200 OK
{
"object": "metrics",
"from": "2026-10-18T00:00:00Z",
"to": "2026-10-25T00:00:00Z",
"granularity": "day",
"dimension": "domain",
"totals": {
"sent": 12400,
"delivered": 12210,
"bounced": 95,
"delayed": 3,
"complained": 4,
"opened": 4380,
"human_opened": 2409,
"clicked": 912,
"suppressed": 2,
"failed": 0,
"delivery_rate": 0.9847,
"bounce_rate": 0.0077,
"complaint_rate": 0.0003,
"open_rate": 0.3587,
"human_open_rate": 0.1972,
"click_rate": 0.0747
},
"series": [
{
"time": "2026-10-18T00:00:00Z",
"sent": 1700,
"delivered": 1676,
"bounced": 14,
"delayed": 3,
"complained": 1,
"opened": 601,
"human_opened": 331,
"clicked": 120,
"suppressed": 2,
"failed": 0,
"delivery_rate": 0.9859,
"bounce_rate": 0.0082,
"complaint_rate": 0.0006,
"open_rate": 0.3586,
"human_open_rate": 0.1974,
"click_rate": 0.0716
}
],
"groups": [
{
"value": "acme.com",
"sent": 9800,
"delivered": 9668,
"bounced": 70,
"delayed": 3,
"complained": 3,
"opened": 3540,
"human_opened": 1947,
"clicked": 760,
"suppressed": 2,
"failed": 0,
"delivery_rate": 0.9865,
"bounce_rate": 0.0071,
"complaint_rate": 0.0003,
"open_rate": 0.3662,
"human_open_rate": 0.2013,
"click_rate": 0.0786
},
{
"value": "news.acme.com",
"sent": 2600,
"delivered": 2542,
"bounced": 25,
"delayed": 3,
"complained": 1,
"opened": 840,
"human_opened": 462,
"clicked": 152,
"suppressed": 2,
"failed": 0,
"delivery_rate": 0.9777,
"bounce_rate": 0.0096,
"complaint_rate": 0.0004,
"open_rate": 0.3304,
"human_open_rate": 0.1817,
"click_rate": 0.0598
}
]
}