Global Stats
Get overall tracking statistics for your organization.
Endpoint
GET /api/statsAuthentication
Requires an API key via the x-api-key header.
Example Request
curl -X GET NEXT_PUBLIC_BASE_URL/api/stats \
-H "x-api-key: your-api-key"Response
Returns the total tracking statistics for all emails in your organization.
Response Schema
| Field | Type | Description |
|---|---|---|
totalEmails | number | Total number of tracked emails |
totalOpens | number | Total number of email opens |
totalClicks | number | Total number of link clicks |
openRate | number | Percentage of emails opened (0-100) |
clickRate | number | Percentage of emails with at least one click (0-100) |
Example Response
{
"totalEmails": 2847,
"totalOpens": 1948,
"totalClicks": 689,
"openRate": 68.42,
"clickRate": 24.2
}TypeScript Types
interface TrackingStats {
totalEmails: number;
totalOpens: number;
totalClicks: number;
openRate: number;
clickRate: number;
}Error Responses
| Status | Description |
|---|---|
401 Unauthorized | Invalid or missing API key |
Example Error
{
"error": "Unauthorized"
}Usage Notes
- Open Rate is calculated as:
(emails with at least one open / total emails) * 100 - Click Rate is calculated as:
(emails with at least one click / total emails) * 100 - Stats are aggregated across all campaigns and standalone emails
Last updated on