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.

Query parameters

ParameterTypeRequiredDescription
periodstringNoAggregation period: hour, day, week, or month. Defaults to day.
fromstringNoStart date in ISO 8601 format (e.g. 2025-09-01T00:00:00.000Z).
tostringNoEnd date in ISO 8601 format. Defaults to now.

Response

{
  "period": "day",
  "from": "2025-09-01T00:00:00.000Z",
  "to": "2025-09-15T23:59:59.999Z",
  "totals": {
    "sent": 12500,
    "delivered": 12100,
    "opened": 4800,
    "clicked": 1200,
    "bounced": 350,
    "complained": 50
  },
  "timeseries": [
    {
      "timestamp": "2025-09-01T00:00:00.000Z",
      "sent": 850,
      "delivered": 830,
      "opened": 320,
      "clicked": 80,
      "bounced": 18,
      "complained": 2
    },
    {
      "timestamp": "2025-09-02T00:00:00.000Z",
      "sent": 920,
      "delivered": 900,
      "opened": 350,
      "clicked": 95,
      "bounced": 15,
      "complained": 5
    }
  ]
}

Examples

curl "https://api.kraiter.com/api/metrics?period=day&from=2025-09-01T00:00:00.000Z&to=2025-09-15T23:59:59.999Z" \
  -H "Authorization: Bearer YOUR_API_KEY"
const metrics = await kraiter.metrics.get({
  period: "day",
  from: "2025-09-01T00:00:00.000Z",
  to: "2025-09-15T23:59:59.999Z",
});

console.log(metrics.totals.delivered); // 12100
console.log(metrics.timeseries.length); // 15 data points

Sequence metrics

GET /api/metrics/sequences/:id

Returns metrics for a specific sequence.

Path parameters

ParameterTypeDescription
idstringThe sequence ID.

Query parameters

ParameterTypeRequiredDescription
periodstringNoAggregation period: hour, day, week, or month. Defaults to day.
fromstringNoStart date in ISO 8601 format.
tostringNoEnd date in ISO 8601 format. Defaults to now.

Response

Same format as tenant-wide metrics, scoped to the specified sequence.

Errors

CodeDescription
NOT_FOUNDNo sequence with this ID exists.

Examples

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

Template metrics

GET /api/metrics/templates/:id

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

Path parameters

ParameterTypeDescription
idstringThe template ID.

Query parameters

ParameterTypeRequiredDescription
periodstringNoAggregation period: hour, day, week, or month. Defaults to day.
fromstringNoStart date in ISO 8601 format.
tostringNoEnd date in ISO 8601 format. Defaults to now.

Response

Same format as tenant-wide metrics, scoped to the specified template.

Errors

CodeDescription
NOT_FOUNDNo template with this ID exists.

Examples

curl "https://api.kraiter.com/api/metrics/templates/welcome-email?period=month&from=2025-06-01T00:00:00.000Z" \
  -H "Authorization: Bearer YOUR_API_KEY"
const metrics = await kraiter.metrics.template("welcome-email", {
  period: "month",
  from: "2025-06-01T00:00:00.000Z",
});

Metric fields

All metrics responses include these fields in the totals object and each timeseries entry:

FieldDescription
sentTotal emails sent (handed off to SES).
deliveredEmails confirmed delivered to the recipient's mail server.
openedUnique opens (tracked via pixel).
clickedUnique clicks on tracked links.
bouncedHard and soft bounces combined.
complainedSpam complaints received via feedback loops.

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

PeriodDescription
hourOne data point per hour. Best for real-time monitoring.
dayOne data point per day. Default.
weekOne data point per week (starting Monday).
monthOne data point per calendar month.

Choose a period appropriate for your date range. Using hour with a 90-day range will return a large number of data points.