REST API

The Gurulu REST API provides programmatic access to your analytics data, site management, events, audiences, and more. All responses are JSON.

Base URL

https://gurulu.io/api/v1

Authentication

All API requests require a Bearer token. Use a secret key from Settings > Developer > API Keys:

curl -H "Authorization: Bearer gsk_live_..." \
  https://gurulu.io/api/v1/sites

Keys prefixed with gsk_live_ have full read/write access. Keys prefixed with gsk_test_ are read-only.

Key endpoints

Sites

MethodPathDescription
GET/api/v1/sitesList all sites
GET/api/v1/sites/:idGet site details
POST/api/v1/sitesCreate a new site

Ingest

curl -X POST https://gurulu.io/api/ingest \
  -H "Content-Type: application/json" \
  -d '{
    "siteId": "YOUR_SITE_ID",
    "token": "YOUR_TOKEN",
    "events": [
      { "type": "pageview", "url": "/pricing", "ts": 1713200000 }
    ]
  }'

Analytics

MethodPathDescription
GET/api/analytics/overviewOverview metrics
GET/api/analytics/funnelsDiscovered funnels
GET/api/analytics/flow-graphProduct flow graph
GET/api/analytics/milestonesBusiness milestones
GET/api/analytics/healthSite health score
GET/api/analytics/driftElement drift alerts

Events

MethodPathDescription
GET/api/events/catalogEvent catalog
POST/api/events/definitionsDefine custom event

Audiences

MethodPathDescription
GET/api/cli/audiencesList audiences
POST/api/cli/audiencesCreate audience

Rate limits

API requests are rate-limited per key:

  • Read endpoints: 120 requests/minute
  • Write endpoints: 30 requests/minute
  • Ingest endpoint: 1000 events/second per site

Rate limit headers (X-RateLimit-Remaining, X-RateLimit-Reset) are included in every response.