BuddyStat

Webhooks & Public API

Outgoing webhooks and REST API for real-time data streaming

BuddyStat provides two integration methods: outgoing webhooks for push-based event streaming and a REST API for pull-based data access.

Outgoing Webhooks

Webhooks allow BuddyStat to send real-time event data to your own servers via HTTP POST requests.

Supported Events

  • session.created — A new session begins
  • goal.converted — A visitor completes a tracked goal
  • alert.triggered — An alert threshold is crossed
  • event.tracked — A custom event is triggered

Security

Each webhook payload is signed with HMAC-SHA256 using your webhook's secret key. Verify the signature on your end to ensure the payload came from BuddyStat and hasn't been tampered with.

Delivery

  • 10-second timeout — Your endpoint must respond within 10 seconds
  • Delivery audit log — Each delivery attempt is logged with status code, response body, and timestamp
  • Retry on failure — Failed deliveries are retried

Managing Webhooks

  1. Go to Site Settings → Webhooks
  2. Click Add Webhook
  3. Enter your endpoint URL
  4. Select which events to receive
  5. Save and copy your secret key for signature verification

REST API

The public REST API v1 provides programmatic access to your analytics data.

Authentication

Use Bearer token authentication with an API key. Create API keys in Account Settings → API Keys.

Endpoints

EndpointDescription
GET /api/v1/sitesList your sites
GET /api/v1/sites/:siteId/statsDashboard overview stats
GET /api/v1/sites/:siteId/pagesPage analytics
GET /api/v1/sites/:siteId/revenueRevenue metrics
GET /api/v1/sites/:siteId/experimentsExperiment list
GET /api/v1/sites/:siteId/sessionsSession data
GET /api/v1/sites/:siteId/eventsEvent data
GET /api/v1/sites/:siteId/events/namesEvent names list

Rate Limits

  • 50 requests per minute per API key
  • Rate limit headers included in responses (X-RateLimit-Remaining, X-RateLimit-Reset)

Code Examples

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://app.buddystat.com/api/v1/sites/1/stats
const response = await fetch('https://app.buddystat.com/api/v1/sites/1/stats', {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const data = await response.json();