import requests
# Get Q1 2024 aggregate stats for sub-account 11
url = "https://api.sendpost.io/api/v1/account/subaccount/stat/11/aggregate"
params = {"from": "2024-01-01", "to": "2024-03-31"}
headers = {
"accept": "application/json",
"X-Account-ApiKey": "<account_api_key>"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
curl --request GET \
--url https://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate \
--header 'X-Account-ApiKey: <api-key>'const options = {method: 'GET', headers: {'X-Account-ApiKey': '<api-key>'}};
fetch('https://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate', 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.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Account-ApiKey: <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://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-ApiKey", "<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://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate")
.header("X-Account-ApiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Account-ApiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"processed": 1000,
"sent": 990,
"dropped": 8,
"smtpDropped": 2,
"delivered": 975,
"softBounced": 10,
"hardBounced": 5,
"opened": 450,
"clicked": 120,
"unsubscribed": 3,
"spam": 1
}Get Aggregate Stats
Retrieve summarized email statistics for a sub-account over a date range. Unlike daily stats, this returns a single record with totals across all days—ideal for high-level reporting.
Response includes total counts for:
processed- Total emails submitteddelivered- Successfully delivereddropped- Blocked before sendinghardBounced/softBounced- Bounce breakdownsopens/clicks- Engagement totalsunsubscribed/spams- Negative signals
Use Cases:
- Monthly performance reports
- Executive dashboards
- Billing period summaries
- Year-over-year comparisons
- SLA compliance reports
Example: To get Q1 2024 totals:
GET /account/subaccount/stat/11/aggregate?from=2024-01-01&to=2024-03-31
Note: Maximum date range is 366 days (1 year).
import requests
# Get Q1 2024 aggregate stats for sub-account 11
url = "https://api.sendpost.io/api/v1/account/subaccount/stat/11/aggregate"
params = {"from": "2024-01-01", "to": "2024-03-31"}
headers = {
"accept": "application/json",
"X-Account-ApiKey": "<account_api_key>"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
curl --request GET \
--url https://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate \
--header 'X-Account-ApiKey: <api-key>'const options = {method: 'GET', headers: {'X-Account-ApiKey': '<api-key>'}};
fetch('https://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate', 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.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Account-ApiKey: <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://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-ApiKey", "<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://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate")
.header("X-Account-ApiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/account/subaccount/stat/{subaccount_id}/aggregate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Account-ApiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"processed": 1000,
"sent": 990,
"dropped": 8,
"smtpDropped": 2,
"delivered": 975,
"softBounced": 10,
"hardBounced": 5,
"opened": 450,
"clicked": 120,
"unsubscribed": 3,
"spam": 1
}Authorizations
This api key can be used for all account level operations
Path Parameters
The unique ID of the sub-account.
11
Query Parameters
Start date for aggregation (inclusive). Format YYYY-MM-DD.
"2024-01-01"
End date for aggregation (inclusive). Max 366 days from from date.
"2024-03-31"
Response
Successful response with aggregated statistics.
Aggregated email statistics over a date range. Inherits all fields from Stat schema with the same meanings.
Total number of emails accepted by SendPost API for processing. This is the starting point - all emails submitted through the API.
225
Number of emails sent to recipient mail servers. sent = processed - dropped - smtpDropped
220
Number of emails dropped before sending. Common reasons:
- Recipient email in suppression list (hard bounce, spam complaint, unsubscribe)
- Invalid recipient email format
- Sender domain not verified
10
Number of emails dropped at SMTP level due to policy violations or rate limiting by the receiving server before delivery attempt completed.
5
Number of emails successfully delivered to recipient mail servers. Note: Delivered means accepted by the server, not necessarily in inbox.
200
Number of temporary delivery failures (soft bounces). Common causes:
- Recipient mailbox full
- Server temporarily unavailable
- Message too large SendPost automatically retries soft bounces.
5
Number of permanent delivery failures (hard bounces). Common causes:
- Recipient email doesn't exist
- Domain doesn't exist
- Recipient has blocked sender Hard bounced addresses are automatically added to suppression list.
10
Number of emails opened (tracking pixel loaded). Requires trackOpens=true. Note: Some email clients block tracking pixels.
150
Number of emails with at least one link clicked. Requires trackClicks=true.
50
Number of recipients who clicked the unsubscribe link. Unsubscribed addresses are automatically added to suppression list.
6
Number of spam complaints (recipient marked email as spam). High spam rates can severely impact your sender reputation. Target: Keep spam rate below 0.1%.
2
Was this page helpful?