Amba

Leaderboards

List leaderboards, fetch entries, get the current user's rank.

Source: apps/api/src/routes/client/leaderboards.ts.

Endpoints

MethodPathDescription
GET/client/leaderboardsAll active leaderboard definitions (public columns).
GET/client/leaderboards/:leaderboardIdPaginated ranked entries with user display info.
GET/client/leaderboards/:leaderboardId/meCurrent user's entry + rank.

GET /client/leaderboards

Response 200

{ "data": [{ "id": "…", "name": "…", "metric": "xp", "period": "all_time", "max_entries": 100 }] }

Try it:

GET/client/leaderboards
client auth
curl -X GET 'https://api.amba.dev/client/leaderboards'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/leaderboards' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

GET /client/leaderboards/:leaderboardId

Ordered by rank ASC NULLS LAST.

Query

ParamDefault
limit50
offset0

Response 200

{
  "data": [
    {
      "leaderboard_id": "…",
      "app_user_id": "…",
      "rank": 1,
      "score": 1234,
      "app_users": { "display_name": "…", "avatar_url": "…" }
    }
  ],
  "total": 100,
  "offset": 0,
  "limit": 50
}

Try it:

GET/client/leaderboards/%7B%7BleaderboardId%7D%7D
client auth
curl -X GET 'https://api.amba.dev/client/leaderboards/%7B%7BleaderboardId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/leaderboards/{leaderboardId}' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

GET /client/leaderboards/:leaderboardId/me

Returns { rank: null, score: 0 } if the user has no entry yet.

Response 200

{
  "data": {
    "leaderboard_id": "…",
    "app_user_id": "…",
    "rank": 42,
    "score": 1234,
    "period_start": "…"
  }
}

Try it:

GET/client/leaderboards/%7B%7BleaderboardId%7D%7D/me
client auth
curl -X GET 'https://api.amba.dev/client/leaderboards/%7B%7BleaderboardId%7D%7D/me'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/leaderboards/{leaderboardId}/me' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

On this page