unsent
unsent.dev
API Reference

Metrics

The Metrics API provides high-level performance indicators for your sending domains and overall account health.

Base URL

https://api.unsent.dev/v1/metrics

Overview

The Metrics API aggregates data to give you a birds-eye view of your email performance. It calculates delivery rates, open rates, and click rates over specific periods, broken down by domain.

Features

Performance Overview

Get key performance indicators (KPIs) like delivery and open rates

Endpoints

Get Performance Metrics

GET /v1/metrics

Retrieve aggregated performance metrics for a specified period.

Query Parameters:

ParameterTypeRequiredDefaultDescription
periodstringNomonthThe time period for metrics (day, week, month)

Example Request:

curl -X GET "https://api.unsent.dev/v1/metrics?period=month" \
  -H "Authorization: Bearer your-api-key"

Response (200 OK):

{
  "period": "month",
  "transactionalEmails": 12000,
  "marketingEmails": 5000,
  "totalEmails": 17000,
  "avgDeliveryRate": 99.2,
  "avgOpenRate": 45.5,
  "avgClickRate": 12.3,
  "domains": [
    {
      "id": "dom_123",
      "name": "example.com",
      "emailsSent": 10000
    },
    {
      "id": "dom_456",
      "name": "marketing.example.com",
      "emailsSent": 7000
    }
  ]
}

Error Responses:

  • 400 Bad Request - Invalid period specified
  • 401 Unauthorized - API key is missing or invalid
  • 500 Internal Server Error - Server error

OpenAPI Specification