API Documentation

The Ludex REST API lets you push data, query results, manage dashboards, and embed analytics programmatically.

v2.0 REST JSON

Authentication

All API requests must include an Authorization header with your API key. Generate keys in Settings → API Keys.

# All API requests use Bearer token auth Authorization: Bearer lx_live_your_api_key_here # Base URL https://api.ludex.cc/v2

Events API

Push event data to Ludex in real-time. Events are available for querying within milliseconds.

POST /events Track a single event
// Request { "event": "order_completed", "timestamp": "2025-05-14T10:32:00Z", "user_id": "usr_abc123", "properties": { "order_id": "ord_xyz789", "revenue": 149.99, "currency": "USD", "plan": "professional" } }
POST /events/batch Send up to 1,000 events at once

Query API

Run SQL queries against your data and retrieve results programmatically.

POST /query Run a query
// Request { "sql": "SELECT date_trunc('day', timestamp) as day, COUNT(*) as orders, SUM(revenue) as revenue FROM events WHERE event = 'order_completed' AND timestamp > NOW() - INTERVAL '30 days' GROUP BY 1 ORDER BY 1", "timeout": 30 } // Response { "data": [ { "day": "2025-05-01", "orders": 142, "revenue": 21480.58 }, { "day": "2025-05-02", "orders": 158, "revenue": 23891.20 } ], "execution_time_ms": 47, "rows_returned": 30 }

Dashboards

List, retrieve, and manage dashboards programmatically.

GET/dashboardsList all dashboards
GET/dashboards/{id}Get a dashboard
POST/dashboards/{id}/exportExport to PDF/PNG
POST/dashboards/{id}/shareGenerate share link

Users & Teams

GET/usersList users
POST/usersInvite a user
PUT/users/{id}Update user role
DELETE/users/{id}Remove user

Webhooks

Receive real-time notifications when alerts fire, syncs complete, or other events occur.

// Alert fired webhook payload { "event": "alert.fired", "timestamp": "2025-05-14T10:32:00Z", "alert": { "id": "alt_abc123", "name": "Revenue drop alert", "condition": "daily_revenue < 10000", "current_value": 8432 } }

Rate Limits

PlanEvents APIQuery APIManagement API
Starter100 req/min30 req/min60 req/min
Professional1,000 req/min100 req/min300 req/min
EnterpriseCustomCustomCustom

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.