Get Email Statistics
curl --request GET \
--url https://stats.sendrapp.org/domain/stats \
--header 'Authorization: <api-key>'import requests
url = "https://stats.sendrapp.org/domain/stats"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://stats.sendrapp.org/domain/stats', 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://stats.sendrapp.org/domain/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stats.sendrapp.org/domain/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://stats.sendrapp.org/domain/stats")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stats.sendrapp.org/domain/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"domains": {},
"total_domains": 123
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Stats API
Get Tenant Statistics
Retrieve aggregated email delivery statistics (delivery, bounce, reception counts) for every domain on your tenant. Requires an API key with the domainStats scope.
GET
/
domain
/
stats
Get Email Statistics
curl --request GET \
--url https://stats.sendrapp.org/domain/stats \
--header 'Authorization: <api-key>'import requests
url = "https://stats.sendrapp.org/domain/stats"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://stats.sendrapp.org/domain/stats', 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://stats.sendrapp.org/domain/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stats.sendrapp.org/domain/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://stats.sendrapp.org/domain/stats")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://stats.sendrapp.org/domain/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"domains": {},
"total_domains": 123
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Please note that domain statistics are available through a different API hostname (stats.sendrapp.org). See the Statistics API documentation for more details.
Features
- Real-time email delivery statistics
- Per-domain metrics tracking
- Bounce, delivery, and reception counts
- Last update timestamps
- Total domains count
Response
Returns{ client_id, domains, total_domains }, where domains maps each domain name to { counts: { bounce, delivery, reception }, lastUpdated }.
200 OK: Statistics retrieved successfully401 Unauthorized: Missing/invalid API key, or the key lacks thedomainStatsscope500 Internal Server Error: Unexpected server error
Authenticate with your API key in the
Authorization header. The key must have the domainStats scope.