Get leaderboard
Read one leaderboard in the community that owns your API key, with its schedule, audience, prizes and display settings.
- Method
- GET
- Path
https://api.returning.ai / v1/ leaderboards/ {leaderboardID} - Permission
- leaderboard
- Retries
- Read-only; exact retries are safe
When to use this
- Confirm a leaderboard you just created or changed.
- Read a leaderboard's current schedule, audience and prizes before you update it.
- Check whether a leaderboard is live (
enabled) when traders say they can't see it.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- leaderboardShown in the dashboard as “Leaderboard”
Send a Community API key with the leaderboard permission. The key decides the community, so a leaderboard in another community returns 404.
Behaviour#
enabled decides whether the leaderboard is live. Traders see it only if they are on a view or rank list; @all in roles covers everyone. Dates in duration are read in the leaderboard's timeZone, which is minutes from UTC.
Request#
Path parameters#
_id, from List leaderboards or Create leaderboard.Rule24-character hex ID
Eg66f000000000000000000301
Query parameters#
_id always comes back. Use the stored names here: leaderImage returns image, serverId returns communityID.RuleLeaderboard field names
Egname,slug,enabled,duration
Headers#
leaderboard.RuleBearer <API_KEY>
curl --request GET \
--url https://api.returning.ai/v1/leaderboards/66f000000000000000000301 \
--header 'Authorization: Bearer <API_KEY>'
Response#
A 200 returns the leaderboard in data, with user, role and tag references expanded. Branch on the HTTP status. With fields, only the fields you ask for come back, plus _id.
meta.code on success.Rulesuccess
Eg{ ... }
Eg"66f000000000000000000301"
Eg"66f000000000000000000010"
default for your community's built-in Default Leaderboard, which can't be deleted; custom for every other leaderboard.Eg"Monthly Trading Volume"
Eg"monthly-trading-volume"
Eg"Top traders by trading volume each month."
true when the leaderboard is live for the traders who can see it.Egtrue
Eg2
displayOrder.Eg2
XP, Coins, Referrals, or a user-field key.Eg"tradingvolume"
Eg{ ... }
startTime on this date, in its time zone.Eg"2026-10-01T00:00:00.000Z"
null when there is none.RuleNullable
Egnull
true when the leaderboard runs with no end date.480 for UTC+8.hours (1-12), minutes and ampm.all-time, daily, weekly, monthly, yearly.Eg["monthly", "all-time"]
Eg{ ... }
id (numeric platform user ID), _id, username and email. The last three are null for a trader who has left your community._id and name. name is null for a deleted role._id and name. name is null for a deleted tag.rankedUserRoles.Eg{ ... }
true when scores restart every period.Egtrue
daily, weekly, monthly or yearly.Eg"monthly"
true when prizes are paid.Egfalse
Eg[]
Eg["user", "tier", "level"]
Eg["user", "tier", "level"]
showTop blurs rows below the top value ranks, showPositive hides scores of 0 or less.Eg{ ... }
Eg{}
Eg[]
true when guests can see the leaderboard, if your community allows guest preview.Egfalse
true for the one leaderboard your community has set as its active leaderboard.Egfalse
Eg"2026-09-26T08:30:00.000Z"
Eg"2026-09-26T08:30:00.000Z"
true when the widget can be embedded.Egtrue
Eg"wgt_live_abc123"
Ruledynamic, fixed, object
Eg"fixed"
Eg420
Eg640
Eg["example.com"]
true when the widget uses its own colours instead of your community theme.Egfalse
{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Read leaderboard success.",
"data": {
"_id": "66f000000000000000000301",
"communityID": "66f000000000000000000010",
"kind": "custom",
"name": "Monthly Trading Volume",
"slug": "monthly-trading-volume",
"description": "Top traders by trading volume each month.",
"rankBy": "tradingvolume",
"displayedFields": ["user", "tier", "level"],
"displayFieldsOrder": ["user", "tier", "level"],
"timeFilters": ["monthly", "all-time"],
"performanceDisplay": {
"showTop": {
"enabled": false,
"value": 0
},
"showPositive": {
"enabled": false
},
"showDummy": {
"enabled": false
}
},
"duration": {
"start": "2026-10-01T00:00:00.000Z",
"end": null,
"noEndDate": true,
"timeZone": 0,
"startTime": {
"hours": 12,
"minutes": 0,
"ampm": "AM"
},
"endTime": {
"hours": 11,
"minutes": 59,
"ampm": "PM"
}
},
"rankedUserRoles": {
"users": [],
"roles": [
{
"_id": "66f000000000000000000502",
"name": "@all"
}
],
"tags": []
},
"viewPermissionUserRoles": {
"users": [],
"roles": [
{
"_id": "66f000000000000000000502",
"name": "@all"
}
],
"tags": []
},
"banner": {},
"enableLeaderboardReset": true,
"leaderboardResetFrequency": "monthly",
"enablePrizePool": false,
"prizes": [],
"userInformationDisplay": [],
"enabled": true,
"previewEnabled": false,
"selected": false,
"displayOrder": 2,
"order": 2,
"updatedAt": "2026-09-26T08:30:00.000Z",
"createdAt": "2026-09-26T08:30:00.000Z"
}
}
Errors#
401, 403 and 400 errors carry a code in meta.code. 404, 500 and 502 errors have no code; branch on the HTTP status and read detail.
Fix the request04
VALIDATION_FAILEDFix the requestleaderboardID isn't a valid ID, or fields names a field that doesn't exist. detail names the parameter.AUTH_API_KEY_REQUIREDFix the requestAuthorization: Bearer <API_KEY>.AUTH_API_KEY_INVALIDFix the requestAUTH_PERMISSION_REQUIREDFix the requestleaderboard. Add the permission in Settings > Integration > API Keys.Fix the data01
Retry with backoff03
AUTH_API_KEY_VALIDATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 400,
"code": "VALIDATION_FAILED"
},
"message": "Validation failed",
"detail": {
"leaderboardID": "leaderboardID must be a valid MongoDB ObjectId string"
},
"solution": "Please check the request and try again"
}