Kraiter
API Reference

Metrics

Retrieve engagement analytics for your organisation, sequences, and templates.

The Metrics API provides engagement analytics across your organisation. Query aggregate statistics like sends, deliveries, opens, clicks, bounces, and complaints over configurable time periods.

Tenant-wide metrics

GET /api/metrics

Returns aggregate metrics for your entire organisation, either monthly (default) or daily. Counters are returned as a single metrics object — there is no totals/timeseries split.

Query parameters

ParameterTypeRequiredDescription
periodstringNodaily or monthly. Defaults to monthly.
yearMonthstringNoFor monthly: the month as YYYY-MM. Defaults to the current month.
datestringNoFor daily: a single day as YYYY-MM-DD. Defaults to today.
startDatestringNoFor daily: start of a date range (YYYY-MM-DD). Use with endDate.
endDatestringNoFor daily: end of a date range (YYYY-MM-DD).

Response

Monthly (or single-day) requests return the period key plus a metrics object:

{
  "period": "monthly",
  "yearMonth": "2025-09",
  "metrics": {
    "scheduled": 12800,
    "sent": 12500,
    "cancelled": 60,
    "delivered": 12100,
    "bounced": 350,
    "bouncedHard": 210,
    "bouncedSoft": 140,
    "complained": 50,
    "opened": 4800,
    "clicked": 1200,
    "replied": 90,
    "updatedAt": "2025-09-30T23:59:59.999Z"
  }
}

A daily range request (period=daily with startDate and endDate) instead returns startDate, endDate, and a metrics array with one entry per day.

Examples

# Current month (default)
curl "https://api.kraiter.com/api/metrics" \
  -H "Authorization: Bearer YOUR_API_KEY"

# A specific month
curl "https://api.kraiter.com/api/metrics?yearMonth=2025-09" \
  -H "Authorization: Bearer YOUR_API_KEY"

# A daily range
curl "https://api.kraiter.com/api/metrics?period=daily&startDate=2025-09-01&endDate=2025-09-15" \
  -H "Authorization: Bearer YOUR_API_KEY"
const metrics = await kraiter.metrics.get({ yearMonth: "2025-09" });

console.log(metrics.metrics.delivered); // 12100

Sequence metrics

GET /api/metrics/sequences/:id

Returns monthly metrics for a specific sequence.

Path parameters

ParameterTypeDescription
idstringThe sequence ID.

Query parameters

ParameterTypeRequiredDescription
yearMonthstringNoThe month as YYYY-MM. Defaults to the current month.

Response

Returns sequenceId, yearMonth, and a metrics object with the same counters as tenant-wide metrics.

{
  "sequenceId": "onboarding",
  "yearMonth": "2025-09",
  "metrics": {
    "scheduled": 1200,
    "sent": 1180,
    "delivered": 1150,
    "opened": 640,
    "clicked": 210,
    "bounced": 20,
    "complained": 3,
    "updatedAt": "2025-09-30T23:59:59.999Z"
  }
}

Errors

CodeDescription
SEQUENCE_NOT_FOUNDNo sequence with this ID exists.

Examples

curl "https://api.kraiter.com/api/metrics/sequences/onboarding?yearMonth=2025-09" \
  -H "Authorization: Bearer YOUR_API_KEY"
const metrics = await kraiter.metrics.sequence("onboarding", {
  yearMonth: "2025-09",
});

To list every sequence's metrics for a month at once, use GET /api/metrics/sequences (returns an items array with a yearMonth and optional nextCursor).


Template metrics

GET /api/metrics/templates/:id

Returns monthly metrics for a specific template across all sends (both transactional and sequence-based).

Path parameters

ParameterTypeDescription
idstringThe template ID.

Query parameters

ParameterTypeRequiredDescription
yearMonthstringNoThe month as YYYY-MM. Defaults to the current month.

Response

Returns templateId, yearMonth, and a metrics object with the same counters as tenant-wide metrics.

Errors

CodeDescription
TEMPLATE_NOT_FOUNDNo template with this ID exists.

Examples

curl "https://api.kraiter.com/api/metrics/templates/welcome-email?yearMonth=2025-06" \
  -H "Authorization: Bearer YOUR_API_KEY"
const metrics = await kraiter.metrics.template("welcome-email", {
  yearMonth: "2025-06",
});

To list every template's metrics for a month at once, use GET /api/metrics/templates (returns an items array with a yearMonth and optional nextCursor).


Metric fields

Every metrics object includes these counters:

FieldDescription
scheduledSends scheduled during the period.
sentTotal emails sent (handed off to SES).
cancelledScheduled sends cancelled by a gate before sending.
deliveredEmails confirmed delivered to the recipient's mail server.
bouncedHard and soft bounces combined.
bouncedHardPermanent (hard) bounces.
bouncedSoftTemporary (soft) bounces.
complainedSpam complaints received via feedback loops.
openedOpens (tracked via pixel).
clickedClicks on tracked links.
repliedReplies received.
updatedAtWhen the metrics were last updated (ISO 8601).

Derived rates

The API returns raw counts. To calculate rates, divide by the relevant base:

RateFormula
Delivery ratedelivered / sent
Open rateopened / delivered
Click rateclicked / delivered
Bounce ratebounced / sent
Complaint ratecomplained / delivered

Aggregation periods

Tenant-wide metrics support two periods; sequence and template metrics are monthly only.

PeriodDescription
monthlyOne aggregated metrics object for a calendar month (yearMonth). The default.
dailyA single day (date) or, with startDate/endDate, an array of per-day metrics.