Hookbase
Docs
GuideAPI ReferenceIntegrationsUse CasesCLIMCP
Getting StartedSDK ReferencePortal ComponentsAPI Reference
Get Started

API Reference

OverviewAPI ExplorerAuthenticationAPI Keys

Core Endpoints

SourcesDestinationsRoutesEventsDeliveriesDelivery ClustersTransformsFiltersSchemasWebhook IngestAnalytics

Development Tools

TunnelsCron JobsCron GroupsScheduled Sends

Administration

Custom DomainsAudit LogsNotification ChannelsAlert RulesRedaction PoliciesObservability Export
DocsReceiveAPIAnalytics

Analytics API

Real-time and historical analytics for webhook events, deliveries, and source performance.

Endpoints

MethodPathDescription
GET/api/analyticsGet analytics overview
GET/api/analytics/timelineGet time-bucketed events timeline
GET/api/analytics/streamSSE real-time stream

Analytics Overview

GET /api/analytics

Query Parameters

ParameterTypeDescription
periodstringTime period: 1h, 24h, 7d, 30d (default: 24h)
sourceIdstringFilter by source
destinationIdstringFilter by destination

Example

curl "https://api.hookbase.app/api/analytics?period=24h" \
  -H "Authorization: Bearer whr_your_api_key"

Response

{
  "period": "24h",
  "summary": {
    "totalEvents": 15230,
    "totalDeliveries": 28100,
    "successRate": 98.5,
    "avgLatency": 245,
    "duplicatesDropped": 120,
    "eventsFiltered": 3400
  },
  "sources": [
    {
      "id": "src_github",
      "name": "GitHub",
      "eventsReceived": 8200,
      "signatureValid": 8200,
      "signatureInvalid": 0,
      "duplicatesDropped": 85
    },
    {
      "id": "src_stripe",
      "name": "Stripe",
      "eventsReceived": 7030,
      "signatureValid": 7028,
      "signatureInvalid": 2,
      "duplicatesDropped": 35
    }
  ],
  "destinations": [
    {
      "id": "dst_api",
      "name": "Production API",
      "deliveries": 15200,
      "succeeded": 15050,
      "failed": 150,
      "successRate": 99.0,
      "avgLatency": 180,
      "p50Latency": 120,
      "p95Latency": 450,
      "p99Latency": 890
    }
  ],
  "statusBreakdown": {
    "delivered": 27700,
    "failed": 200,
    "pending": 50,
    "retrying": 100,
    "circuit_open": 50
  }
}

Events Timeline

GET /api/analytics/timeline

Returns time-bucketed event counts for charting.

Query Parameters

ParameterTypeDescription
rangestringTime range: 1h, 24h, 7d, 30d (default: 24h)
startDatestringCustom range start (ISO 8601)
endDatestringCustom range end (ISO 8601)

Example

curl "https://api.hookbase.app/api/analytics/timeline?range=24h" \
  -H "Authorization: Bearer whr_your_api_key"

Response

{
  "period": "24h",
  "interval": "1h",
  "buckets": [
    {
      "timestamp": "2024-01-15T00:00:00Z",
      "eventsReceived": 620,
      "deliveriesSucceeded": 1180,
      "deliveriesFailed": 12
    },
    {
      "timestamp": "2024-01-15T01:00:00Z",
      "eventsReceived": 580,
      "deliveriesSucceeded": 1100,
      "deliveriesFailed": 8
    }
  ]
}

Real-Time Stream

GET /api/analytics/stream

Server-Sent Events (SSE) stream for real-time dashboard updates.

Example

curl -N "https://api.hookbase.app/api/analytics/stream" \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Accept: text/event-stream"

Events

event: stats
data: {"eventsPerMinute": 42, "deliveriesPerMinute": 78, "successRate": 99.1, "avgLatency": 180}
 
event: event
data: {"id": "evt_abc123", "sourceId": "src_github", "sourceName": "GitHub", "status": "delivered", "receivedAt": "2024-01-15T10:30:00Z"}
 
event: delivery
data: {"id": "dlv_xyz789", "eventId": "evt_abc123", "destinationName": "Production API", "status": "delivered", "latency": 180}

Event Types

EventDescriptionFrequency
statsAggregated metrics snapshotEvery 5 seconds
eventIndividual event receivedReal-time
deliveryIndividual delivery completedReal-time
alertFailure or circuit breaker alertOn occurrence

Client Example

const eventSource = new EventSource(
  'https://api.hookbase.app/api/analytics/stream',
  { headers: { 'Authorization': 'Bearer whr_your_api_key' } }
);
 
eventSource.addEventListener('stats', (e) => {
  const stats = JSON.parse(e.data);
  console.log(`Events/min: ${stats.eventsPerMinute}`);
});
 
eventSource.addEventListener('event', (e) => {
  const event = JSON.parse(e.data);
  console.log(`New event: ${event.id} from ${event.sourceName}`);
});

Related

  • Events API — Query individual events
  • Deliveries API — Query delivery details
PreviousWebhook IngestNextTunnels

On this page

EndpointsAnalytics OverviewQuery ParametersExampleResponseEvents TimelineQuery ParametersExampleResponseReal-Time StreamExampleEventsEvent TypesClient ExampleRelated