Leaderboards
Leaderboard definitions (metric, period, max entries) + admin-side ranked entries.
Leaderboards are named rankings of users by a metric (xp, streak_length, custom). Entries are written automatically by the engagement pipeline; ranking and tiebreaker logic is shared with the segment-rule and gamification engines.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/leaderboards | Create a leaderboard. |
| GET | /admin/projects/:projectId/leaderboards | List leaderboards. |
| GET | /admin/projects/:projectId/leaderboards/:leaderboardId | Fetch. |
| PATCH | /admin/projects/:projectId/leaderboards/:leaderboardId | Partial update. |
| DELETE | /admin/projects/:projectId/leaderboards/:leaderboardId | Delete. |
| GET | /admin/projects/:projectId/leaderboards/:leaderboardId/entries | Paginated ranked entries with user display info. |
POST /admin/projects/:projectId/leaderboards
Request
| Field | Type | Required | Default |
|---|---|---|---|
name | string | yes | — |
metric | string | yes | — |
period | string | no | "all_time" |
max_entries | number | no | 100 |
custom_event | string | no | null |
Response 201
Try it:
POST
developer auth/admin/projects/%7B%7BprojectId%7D%7D/leaderboardscurl -X POST 'https://api.amba.dev/v1/admin/projects/%7B%7BprojectId%7D%7D/leaderboards'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/leaderboards
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/leaderboardscurl -X GET 'https://api.amba.dev/v1/admin/projects/%7B%7BprojectId%7D%7D/leaderboards'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/leaderboards/:leaderboardId
Errors
404 NOT_FOUND.
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7Dcurl -X GET 'https://api.amba.dev/v1/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
PATCH /admin/projects/:projectId/leaderboards/:leaderboardId
Allowed fields: name, metric, period, max_entries, custom_event, is_active.
Try it:
PATCH
developer auth/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7Dcurl -X PATCH 'https://api.amba.dev/v1/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
DELETE /admin/projects/:projectId/leaderboards/:leaderboardId
Try it:
DELETE
developer auth/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7Dcurl -X DELETE 'https://api.amba.dev/v1/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/leaderboards/:leaderboardId/entries
Paginated entries ordered by rank ascending (entries without a rank sort last). Each row carries the user's display_name and avatar_url.
Query
| Param | Default |
|---|---|
limit | 50 |
offset | 0 |
Response 200
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7D/entriescurl -X GET 'https://api.amba.dev/v1/admin/projects/%7B%7BprojectId%7D%7D/leaderboards/%7B%7BleaderboardId%7D%7D/entries'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl: