Event tracking, stream analytics, and dashboard data for the WAVE platform.
| Method | Path | Summary |
|---|---|---|
POST | /analytics/events | Track analytics event |
GET | /analytics/dashboards | Get dashboard metrics |
GET | /analytics/stream/{streamId} | Get stream-level analytics |
POST | /analytics/events/batch | Track batch of events |
{% api-endpoint method=“POST” path=“/analytics/events” /%}
Track analytics event
Operation ID: trackEvent
Content-Type: application/json
| Required
| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | Event type category |
eventName | string | Yes | Specific event name |
sessionId | string | Yes | Client session identifier |
properties | object | No | Event-specific properties |
userId | string | No | User ID (if not authenticated via Bearer token) |
anonymousId | string | No | Anonymous user identifier |
experiments | object | No | Active experiment assignments |
platform | string | No | Default: "web". Values: web, ios, android |
Event tracked
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | - |
eventId | string | No | - |
Missing required fields
{% tabs %} {% tab label=“cURL” %}
curl -X POST 'https://api.wave.online/api/v1/analytics/events' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"eventType": "stream",
"eventName": "stream.started",
"sessionId": "sess_abc123",
"properties": {
"streamId": "str_xyz789",
"protocol": "webrtc"
},
"platform": "web"
}'
{% /tab %} {% tab label=“TypeScript” %}
import { WaveClient } from "@wave/sdk";
const client = new WaveClient({ apiKey: "your-api-key" });
const result = await client.analytics.trackEvent({
eventType: "stream",
eventName: "stream.started",
sessionId: "sess_abc123",
properties: { streamId: "str_xyz789", protocol: "webrtc" },
platform: "web",
});
console.log(result);
{% /tab %} {% tab label=“Python” %}
from wave_sdk import WaveClient
client = WaveClient(api_key="your-api-key")
result = client.analytics.track_event(
event_type="stream",
event_name="stream.started",
session_id="sess_abc123",
properties={"streamId": "str_xyz789", "protocol": "webrtc"},
platform="web"
)
print(result)
{% /tab %} {% /tabs %}
{% api-endpoint method=“GET” path=“/analytics/dashboards” /%}
Get dashboard metrics
Operation ID: getDashboardMetrics
| Name | Type | Required | Description |
|---|---|---|---|
period | string | No | Default: 7d. Values: 1d, 7d, 30d, 90d |
metric | string | No | Filter to specific metric |
Dashboard data
| Field | Type | Required | Description |
|---|---|---|---|
metrics | object | Yes | Aggregated metrics |
period | string | Yes | Reporting period |
{% tabs %} {% tab label=“cURL” %}
curl -X GET 'https://api.wave.online/api/v1/analytics/dashboards?period=7d' \
-H 'Authorization: Bearer YOUR_API_KEY'
{% /tab %} {% /tabs %}
{% api-endpoint method=“GET” path=“/analytics/stream/{streamId}” /%}
Get stream-level analytics
Operation ID: getStreamAnalytics
| Name | Type | Required | Description |
|---|---|---|---|
streamId | string | Yes | Stream ID |
| Name | Type | Required | Description |
|---|---|---|---|
period | string | No | Default: 24h. Values: 1h, 24h, 7d, 30d |
Stream analytics
| Field | Type | Required | Description |
|---|---|---|---|
streamId | string | Yes | - |
totalViewers | integer | Yes | - |
peakViewers | integer | Yes | - |
avgWatchTime | number | Yes | Average in seconds |
totalDuration | number | Yes | Total stream duration |
quality | object | No | Quality metrics |
{% tabs %} {% tab label=“cURL” %}
curl -X GET 'https://api.wave.online/api/v1/analytics/stream/str_xyz789?period=24h' \
-H 'Authorization: Bearer YOUR_API_KEY'
{% /tab %} {% /tabs %}
{% api-endpoint method=“POST” path=“/analytics/events/batch” /%}
Track batch of analytics events
Operation ID: trackEventBatch
Content-Type: application/json
| Required
| Field | Type | Required | Description |
|---|---|---|---|
events | object[] | Yes | Array of event objects (max 100) |
Batch processed
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | - |
accepted | integer | Yes | Number of events tracked |
rejected | integer | No | Number of rejected events |
{% tabs %} {% tab label=“cURL” %}
curl -X POST 'https://api.wave.online/api/v1/analytics/events/batch' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"events": [
{ "eventType": "stream", "eventName": "viewer.joined", "sessionId": "sess_abc123" },
{ "eventType": "stream", "eventName": "viewer.left", "sessionId": "sess_abc123" }
]
}'
{% /tab %} {% /tabs %}