Skip to main content
GET
/
v1
/
emails
/
{emailId}
/
metrics
Node.js SDK
import Migma from 'migma';

const migma = new Migma('YOUR_API_KEY');

const { data } = await migma.emails.metrics('EMAIL_ID');
console.log(data.summary);
{
  "success": true,
  "data": {
    "summary": {
      "totalEmails": 123,
      "delivered": 123,
      "opened": 123,
      "clicked": 123,
      "bounced": 123,
      "complained": 123,
      "unsubscribed": 123,
      "deliveryRate": 123,
      "openRate": 123,
      "clickRate": 123,
      "bounceRate": 123,
      "complaintRate": 123,
      "unsubscribeRate": 123
    },
    "lastUpdated": "2023-11-07T05:31:56Z",
    "timeSeries": [
      {
        "date": "<string>",
        "sent": 123,
        "delivered": 123,
        "opened": 123,
        "clicked": 123,
        "bounced": 123,
        "complained": 123
      }
    ],
    "countryBreakdown": [
      {
        "country": "<string>",
        "count": 123
      }
    ],
    "cached": true
  },
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → Developers → API Keys.

Path Parameters

emailId
string
required

Email ID returned in generation status result.emails[].emailId.

Pattern: ^[0-9a-fA-F]{24}$

Response

Email metrics

success
boolean
required
data
object

Aggregate performance for one generated email across every API send of it. Sourced from the tracking worker, so values may be slightly stale and cover roughly the last 30 days of raw send history (aggregates persist longer). Opens are directional: Apple Mail Privacy Protection and bots inflate them; clicks and delivery events are stronger signals.

error
string | null