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/v1Authentication
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/sitesKeys prefixed with gsk_live_ have full read/write access. Keys prefixed with gsk_test_ are read-only.
Key endpoints
Sites
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/sites | List all sites |
| GET | /api/v1/sites/:id | Get site details |
| POST | /api/v1/sites | Create 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
| Method | Path | Description |
|---|---|---|
| GET | /api/analytics/overview | Overview metrics |
| GET | /api/analytics/funnels | Discovered funnels |
| GET | /api/analytics/flow-graph | Product flow graph |
| GET | /api/analytics/milestones | Business milestones |
| GET | /api/analytics/health | Site health score |
| GET | /api/analytics/drift | Element drift alerts |
Events
| Method | Path | Description |
|---|---|---|
| GET | /api/events/catalog | Event catalog |
| POST | /api/events/definitions | Define custom event |
Audiences
| Method | Path | Description |
|---|---|---|
| GET | /api/cli/audiences | List audiences |
| POST | /api/cli/audiences | Create 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.