Hogsend
API Reference

Metrics API

System overview, journey performance, email metrics, deliverability trends, and event volume analytics.

Metrics endpoints provide real-time analytics computed via SQL aggregates. No pre-computation or background jobs are needed at typical scale. All require the Authorization: Bearer <api-key> header.

Overview

GET /v1/admin/metrics/overview

System-wide summary metrics across contacts, journeys, and emails.

Response 200

{
  "totalContacts": 1250,
  "activeJourneys": 8,
  "emailsSent24h": 340,
  "emailsSent7d": 2100,
  "emailsSent30d": 8500,
  "bounceRate30d": 0.012,
  "unsubscribeRate": 0.034
}
FieldTypeDescription
totalContactsnumberTotal non-deleted contacts
activeJourneysnumberJourneys with at least one active/waiting state
emailsSent24hnumberEmails sent in the last 24 hours
emailsSent7dnumberEmails sent in the last 7 days
emailsSent30dnumberEmails sent in the last 30 days
bounceRate30dnumberBounce rate over last 30 days (0-1)
unsubscribeRatenumberGlobal unsubscribe rate (0-1)
curl -H "Authorization: Bearer your-api-key" \
  http://localhost:3002/v1/admin/metrics/overview

Journey Performance

GET /v1/admin/metrics/journeys

Per-journey performance metrics across all registered journeys.

Response 200

{
  "journeys": [
    {
      "journeyId": "activation-welcome",
      "name": "Activation -- Welcome Series",
      "enrolled": 500,
      "completed": 340,
      "failed": 12,
      "exited": 45,
      "active": 103,
      "completionRate": 0.68,
      "avgDurationSecs": 86400
    }
  ]
}
FieldTypeDescription
journeyIdstringJourney identifier
namestringJourney display name
enrollednumberTotal enrollments
completednumberSuccessfully completed
failednumberFailed with error
exitednumberExited via exit conditions or cancellation
activenumberCurrently active or waiting
completionRatenumberCompletion ratio (0-1)
avgDurationSecsnumberAverage time from entry to completion in seconds
curl -H "Authorization: Bearer your-api-key" \
  http://localhost:3002/v1/admin/metrics/journeys

GET /v1/admin/metrics/journeys/{id}

Funnel metrics for a single journey showing progression through stages.

Path Parameters

ParamTypeDescription
idstringJourney ID

Response 200

{
  "enrolled": 500,
  "emailSent": 480,
  "emailOpened": 320,
  "emailClicked": 150,
  "completed": 340,
  "failed": 12,
  "exited": 45
}
FieldTypeDescription
enrollednumberTotal enrollments
emailSentnumberEmails sent within this journey
emailOpenednumberEmails opened
emailClickednumberEmails with at least one click
completednumberCompleted the journey
failednumberFailed with error
exitednumberExited early
curl -H "Authorization: Bearer your-api-key" \
  http://localhost:3002/v1/admin/metrics/journeys/activation-welcome

Email Metrics

GET /v1/admin/metrics/emails

Per-template email performance metrics.

Response 200

{
  "emails": [
    {
      "templateKey": "activation/welcome",
      "sent": 480,
      "delivered": 475,
      "opened": 320,
      "clicked": 150,
      "bounced": 5,
      "deliveryRate": 0.99,
      "openRate": 0.67,
      "clickRate": 0.31
    }
  ]
}
FieldTypeDescription
templateKeystringEmail template identifier
sentnumberTotal sends
deliverednumberSuccessfully delivered
openednumberUnique opens
clickednumberUnique clicks
bouncednumberHard bounces
deliveryRatenumberDelivery ratio (0-1)
openRatenumberOpen ratio (0-1)
clickRatenumberClick ratio (0-1)
curl -H "Authorization: Bearer your-api-key" \
  http://localhost:3002/v1/admin/metrics/emails

GET /v1/admin/metrics/emails/deliverability

Deliverability trends over time, grouped by period.

Query Parameters

ParamTypeDefaultDescription
periodstringdayGrouping period: day, week, or month
fromstring--ISO 8601 datetime lower bound
tostring--ISO 8601 datetime upper bound

Response 200

{
  "deliverability": [
    {
      "date": "2025-01-15",
      "total": 120,
      "delivered": 118,
      "bounced": 1,
      "complained": 1,
      "deliveryRate": 0.983
    }
  ]
}
FieldTypeDescription
datestringPeriod start date
totalnumberTotal emails sent in period
deliverednumberSuccessfully delivered
bouncednumberHard bounces
complainednumberSpam complaints
deliveryRatenumberDelivery ratio for the period (0-1)
curl -H "Authorization: Bearer your-api-key" \
  "http://localhost:3002/v1/admin/metrics/emails/deliverability?period=day&from=2025-01-01T00:00:00Z"

Event Volume

GET /v1/admin/metrics/events

Event volume by name over time, grouped by granularity.

Query Parameters

ParamTypeDefaultDescription
granularitystringdayGrouping: hour, day, or week
fromstring--ISO 8601 datetime lower bound
tostring--ISO 8601 datetime upper bound

Response 200

{
  "events": [
    {
      "event": "user:signed_up",
      "date": "2025-01-15",
      "count": 42
    },
    {
      "event": "user:activated",
      "date": "2025-01-15",
      "count": 28
    }
  ]
}
FieldTypeDescription
eventstringEvent name
datestringPeriod start date/hour
countnumberNumber of events in period
curl -H "Authorization: Bearer your-api-key" \
  "http://localhost:3002/v1/admin/metrics/events?granularity=day&from=2025-01-01T00:00:00Z"

On this page