---
title: "Get Leaderboard"
method: POST
path: "/api/leaderboard"
---

# Get Leaderboard

`POST /api/leaderboard`

## Request

- Base URL: `https://backend.praktiki.io` (the document declares no server; this is the origin it was published from)
- URL: `https://backend.praktiki.io/api/leaderboard`
- Auth: HTTP bearer

Get the leaderboard for a specific challenge.

Args:
    request (LeaderboardRequest): Contains challenge_id and challenge_month_label for which to fetch leaderboard

Returns:
    LeaderboardResponse: Contains challenge_id and challenge_month_label and leaderboard data if available,
    or message indicating insufficient data if leaderboard isn't ready yet.

Raises:
    HTTPException: With appropriate status code for various error cases

## Request body

- LeaderboardRequest
  - `challenge_id` string, required
  - `challenge_month_label` string, required
  - `force_refresh` boolean

## Response `200`

Successful Response

- LeaderboardResponse
  - `challenge_id` string, required
  - `challenge_month_label` string, required
  - `leaderboard` LeaderboardEntry[], required
    - `rank` integer, required
    - `name` string, required
    - `profession` string, required
    - `module_completed` integer, required
  - `status` string
  - `message` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/praktiki/apis/praktiki-api.md) - [All operations](https://skmtc.dev/praktiki/apis/praktiki-api/llms.txt) - [OpenAPI document](https://skmtc.dev/praktiki/apis/praktiki-api/revisions/3428f9e0a922?raw)
