Skip to Content
API ReferenceGlobal Stats

Global Stats

Get overall tracking statistics for your organization.

Endpoint

GET /api/stats

Authentication

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

FieldTypeDescription
totalEmailsnumberTotal number of tracked emails
totalOpensnumberTotal number of email opens
totalClicksnumberTotal number of link clicks
openRatenumberPercentage of emails opened (0-100)
clickRatenumberPercentage 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

StatusDescription
401 UnauthorizedInvalid 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