Get Email Stats
curl --request GET \
--url https://api.example.com/api/v1/emails/statsimport requests
url = "https://api.example.com/api/v1/emails/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/emails/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://api.example.com/api/v1/emails/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/emails/stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/emails/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/emails/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"stats": {
"total": 123,
"sent": 123,
"failed": 123,
"transactional": 123,
"marketing": 123,
"successRate": 123
}
}Emails
Get Email Stats
Retrieve aggregate email sending statistics
GET
/
api
/
v1
/
emails
/
stats
Get Email Stats
curl --request GET \
--url https://api.example.com/api/v1/emails/statsimport requests
url = "https://api.example.com/api/v1/emails/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/emails/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://api.example.com/api/v1/emails/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/emails/stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/emails/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/emails/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"stats": {
"total": 123,
"sent": 123,
"failed": 123,
"transactional": 123,
"marketing": 123,
"successRate": 123
}
}Get aggregate statistics for email sending including totals by type and success rates.
Examples
import { MailBreeze } from "mailbreeze";
const mailbreeze = new MailBreeze({ apiKey: "sk_live_xxx" });
const stats = await mailbreeze.emails.stats();
console.log(`Total: ${stats.total}`);
console.log(`Sent: ${stats.sent}`);
console.log(`Failed: ${stats.failed}`);
console.log(`Transactional: ${stats.transactional}`);
console.log(`Marketing: ${stats.marketing}`);
console.log(`Success rate: ${stats.successRate}%`);
from mailbreeze import MailBreeze
client = MailBreeze(api_key="sk_live_xxx")
stats = await client.emails.stats()
print(f"Total: {stats.total}")
print(f"Sent: {stats.sent}")
print(f"Failed: {stats.failed}")
print(f"Transactional: {stats.transactional}")
print(f"Marketing: {stats.marketing}")
print(f"Success rate: {stats.success_rate}%")
client := mailbreeze.NewClient("sk_live_xxx")
stats, err := client.Emails.Stats(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Total: %d\n", stats.Total)
fmt.Printf("Sent: %d\n", stats.Sent)
fmt.Printf("Failed: %d\n", stats.Failed)
fmt.Printf("Transactional: %d\n", stats.Transactional)
fmt.Printf("Marketing: %d\n", stats.Marketing)
fmt.Printf("Success rate: %.1f%%\n", stats.SuccessRate)
$mailbreeze = new MailBreeze('sk_live_xxx');
$response = $mailbreeze->emails->stats();
$stats = $response['data']['stats'];
echo "Total: " . $stats['total'] . "\n";
echo "Sent: " . $stats['sent'] . "\n";
echo "Failed: " . $stats['failed'] . "\n";
echo "Transactional: " . $stats['transactional'] . "\n";
echo "Marketing: " . $stats['marketing'] . "\n";
echo "Success rate: " . $stats['successRate'] . "%\n";
MailBreeze mailbreeze = MailBreeze.builder()
.apiKey("sk_live_xxx")
.build();
EmailStats stats = mailbreeze.emails().stats();
System.out.println("Total: " + stats.getTotal());
System.out.println("Sent: " + stats.getSent());
System.out.println("Failed: " + stats.getFailed());
System.out.println("Transactional: " + stats.getTransactional());
System.out.println("Marketing: " + stats.getMarketing());
System.out.println("Success rate: " + stats.getSuccessRate() + "%");
let client = MailBreeze::new("sk_live_xxx")?;
let stats = client.emails.stats().await?;
println!("Total: {}", stats.total);
println!("Sent: {}", stats.sent);
println!("Failed: {}", stats.failed);
println!("Transactional: {}", stats.transactional);
println!("Marketing: {}", stats.marketing);
println!("Success rate: {}%", stats.success_rate);
curl "https://api.mailbreeze.com/api/v1/emails/stats" \
-H "Authorization: Bearer sk_live_xxx"
Response
The API returns a nested response with stats inside astats object.
The statistics object containing all metrics.
Show Stats object
Show Stats object
Example Response
{
"success": true,
"data": {
"stats": {
"total": 124,
"sent": 124,
"failed": 0,
"transactional": 110,
"marketing": 14,
"successRate": 100
}
},
"meta": {
"timestamp": "2025-12-27T13:35:49.055Z",
"requestId": "f11f8792-d984-4fb2-a0e4-67f58d1b4000",
"path": "/api/v1/emails/stats"
}
}
Understanding the Metrics
| Metric | Description |
|---|---|
| total | Total emails processed through the system |
| sent | Successfully delivered to recipient servers |
| failed | Emails that couldn’t be delivered |
| transactional | Single-recipient triggered emails (receipts, notifications) |
| marketing | Bulk campaign emails |
| successRate | Percentage: (sent / total) * 100 |
SDKs automatically extract the nested
stats object, so you access fields directly (e.g., stats.total instead of response.stats.total).⌘I