Analytics APIEndpoints

Returns player leaderboards based on video engagement metrics

Ranks the players of the company by how many sessions had an event in a period. Several leaderboards, each with its own event, period and size, can be requested in one call. Periods are whole days in `timezone`.

POST
/events/leaderboard

Authorization

apiToken apiVersion userAgent
X-Api-Token<token>

Access the application and copy your api token, then, just set the header X-Api-Token with it.

In: header

X-Api-Version<token>

The API version to use. Currently supported versions are:

  • v1: The current stable version

A request without this header, or with any other value, is answered by the edge with 404 and {"error_msg":"404 Route Not Found"}.

In: header

User-Agent<token>

A non-empty User-Agent identifying your integration is required. Requests without it are rejected at the edge before reaching the API.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/events/leaderboard" \  -H "Content-Type: application/json" \  -d '{    "company_id": "2b884cba-0b12-42ce-b3a1-7a3182d414df",    "leaderboards": [      {        "leaderboard_limit": 10,        "start_date": "2026-09-01",        "end_date": "2026-10-01",        "event": "finished"      },      {        "leaderboard_limit": 5,        "start_date": "2026-09-01",        "event": "started"      }    ],    "timezone": "America/Sao_Paulo"  }'
[  {    "leaderboard_name": "leaderboard_10",    "event": "finished",    "leaderboards": [      {        "player_id": "64a5c8072e6fd10009828db2",        "total_plays": 100,        "uniq_plays": 50,        "uniq_device_plays": 25      },      {        "player_id": "65fb3c74ab21c70007b3e0dd",        "total_plays": 80,        "uniq_plays": 40,        "uniq_device_plays": 20      }    ]  }]