Update an existing leaderboard
Change the settings of one leaderboard in the community that owns your API key, sending only the fields you want to change.
- Method
- PATCH
- Path
https://api.returning.ai / v1/ leaderboards/ {leaderboardID} - Permission
- leaderboard
- Retries
- No Idempotency-Key; read back before retrying
When to use this
- Extend a competition's end date or switch a leaderboard on or off.
- Change who can see or be ranked on a leaderboard.
- Add prizes, or change the columns traders see in the table.
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#
Only the fields you send change, and the change shows to traders straight away. Unknown fields are ignored, so check spelling. Each of these groups is replaced as a whole when you send any field in it:
- Schedule:
startDate,endDate,hasNoEndDate,timeZone,startTime,endTime.startDateis required, and any part you leave out goes back to its default: no end date off, UTC, 12:00 AM to 11:59 PM. Read the leaderboard first and send the full schedule. - Rank lists and view lists: sending one
allowed...ToRanklist empties the other two rank lists, and the same goes for view lists. Empty arrays are ignored, so a rank or view list can't be cleared completely. - Display flags:
topRankOnly,topRankLimit,onlyPositiveRanks,includeDummyUsers. The ones you leave out are switched off. - Lists and settings objects:
displayedColumns,allowedTimeFilters,prizes,widget,banner,translationsanduserInformationDisplayreplace the current value.
displayOrder moves the leaderboard and shifts the others to make room. The Default Leaderboard can be renamed and switched on or off here, but its rank and view lists can only be changed in the dashboard. Switching it on or off also switches the leaderboard feature for your community, and each change to it is logged in configurationHistory.
Request#
Path parameters#
_id, from List leaderboards or Create leaderboard.Rule24-character hex ID
Eg66f000000000000000000301
Headers#
Body#
Send only the fields you want to change. An empty body changes nothing and returns the leaderboard as it is. Several fields have an older alias, such as rankBy for rankingField; send one of each pair.
Rule1-100 chars
Eg"Monthly Trading Volume"
Rule1-100 chars; lowercase letters, numbers and single hyphens
Eg"monthly-trading-volume"
Eg"Top traders by trading volume each month."
leaderImage if you send both.Rulehttp or https URL
Eg"https://cdn.example.com/leaderboards/monthly-volume.png"
true makes the leaderboard live for the traders who can see it; false hides it.Egtrue
XP, Coins, Referrals, or the key of a user field in your community. Anything else returns 400.RuleXP, Coins, Referrals or a user-field key; no spaces
Eg"tradingvolume"
column, order and visible to hide one. user is always the first column.RuleUp to 50
Eg["user", "tier", "level"]
endDate, hasNoEndDate, timeZone, startTime, endTime).RuleISO 8601 or DD-MM-YYYY
Eg"2026-10-01T00:00:00.000Z"
null for none. Send it with startDate.RuleISO 8601, DD-MM-YYYY or null
Eg"2026-12-31T00:00:00.000Z"
true when the leaderboard has no end date. Reset to false if you change the schedule without it.0 (UTC) if you change the schedule without it.RuleMinutes, e.g. 480 for UTC+8
Eg0
hours (1-12), minutes (0-59) and ampm. Reset to 12:00 AM if you change the schedule without it.endDate, in the same format. Reset to 11:59 PM if you change the schedule without it.all-time, daily, weekly, monthly, yearly. Replaces the current tabs.Eg["monthly", "all-time"]
@all covers every trader. Sending any rank list replaces all three; lists you leave out become empty.Eg["@all"]
Eg["3247779"]
Eg[]
Eg["@all"]
Eg[]
Eg[]
0 leaves the position unchanged.RuleWhole number, 0 or more
Eg2
true restarts scores every period and keeps each finished period as history.Egtrue
enableLeaderboardReset as true.Ruledaily, weekly, monthly, yearly
Eg"monthly"
true pays the prizes rows to the winners when a period ends.Egfalse
Eg[]
true blurs rows below the top topRankLimit ranks. Sending any of topRankOnly, topRankLimit, onlyPositiveRanks or includeDummyUsers resets the ones you leave out to off.topRankOnly is true.RuleWhole number, 1 or more when topRankOnly is true
true shows only traders with a score above 0.true lets guests see the leaderboard, if your community allows guest preview.true when the widget can be embedded.Egtrue
Eg"wgt_live_abc123"
Eg"fixed"
Eg420
Eg640
Eg{ ... }
Eg{"family": "Inter", "size": 14}
Eg{ ... }
Eg["example.com", "partners.example.com"]
true when the widget uses its own colours instead of your community theme.Egfalse
Eg{ ... }
name and description lists of languageCode and translation. Replaces the current translations.Eg{ ... }
full or partial. Replaces the current settings.Eg{"showAvatar": true, "showName": true, "showEmail": false}
Eg{"showHeader": true, "showFilters": true, "rowsPerPage": 25}
image. image wins if you send both.RuleUp to 2,000 chars
Eg"https://cdn.example.com/leaderboards/spring.png"
rankingField. rankingField wins if you send both.Eg"points"
displayedColumns; send it with displayFieldsOrder.Eg["rank", "name", "points", "orders"]
displayedColumns; send it with displayedFields.Eg["rank", "name", "points", "orders"]
allowedTimeFilters. allowedTimeFilters wins if you send both.Eg["all", "monthly", "weekly"]
startDate, endDate, hasNoEndDate, timeZone, startTime and endTime, which win if you send them. start is required.Eg"2026-05-01T00:00:00.000Z"
null.RuleNullable
Egnull
true when there is no end date.users, roles and tags. Alias for the allowed...ToRank fields, which win if you send them.Eg["customer", "affiliate"]
users, roles and tags. Alias for the allowed...ToView fields, which win if you send them.Eg["customer", "affiliate", "admin"]
showTop (enabled, value), showPositive and showDummy. Alias for topRankOnly, topRankLimit, onlyPositiveRanks and includeDummyUsers, which win if you send them.Eg"score"
isEnabled. isEnabled wins if you send both.Egtrue
isPreviewEnabled. isPreviewEnabled wins if you send both.Egfalse
displayOrder. order wins if you send both.Eg2
curl --request PATCH \
--url https://api.returning.ai/v1/leaderboards/66f000000000000000000301 \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"description": "Top traders by trading volume each month. Prizes for the top 3.",
"allowedTimeFilters": ["monthly", "all-time"],
"isEnabled": true
}'
Response#
A 200 returns the whole leaderboard after your change in data, with user, role and tag references expanded, in the same shape as Get leaderboard. Branch on the HTTP status.
meta.code on success.Rulesuccess
Eg{ ... }
Eg"66f000000000000000000301"
default for your community's built-in Default Leaderboard; custom for every other leaderboard.Eg"Monthly Trading Volume"
Eg"monthly-trading-volume"
true when the leaderboard is live.Egtrue
Eg2
displayOrder.Eg2
timeZone is minutes from UTC.Eg{ ... }
Eg"2026-10-01T00:00:00.000Z"
null when there is none.RuleNullable
Egnull
true when the leaderboard runs with no end date.hours (1-12), minutes and ampm.id (numeric platform user ID), _id, username and email; roles and tags as _id and name.true when scores restart every period.Egtrue
Eg"monthly"
true when prizes are paid.Egfalse
Eg[]
Eg{}
Eg[]
true when guests can see it.Egfalse
true for the one leaderboard your community has set as its active leaderboard.Egfalse
Eg"2026-09-27T09:00:00.000Z"
Eg"2026-09-26T08:30:00.000Z"
Eg{"enabled": true, "size": "fixed", "width": 420, "height": 640}
user comes first.{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Update 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. Prizes for the top 3.",
"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-27T09:00:00.000Z",
"createdAt": "2026-09-26T08:30:00.000Z"
}
}
Errors#
401, 403 and 400 VALIDATION_FAILED errors carry a code in meta.code. Other errors from this endpoint have no code; branch on the HTTP status and read detail.
Fix the request05
meta.code; detail says why, such as Invalid rankBy value: ..., rankedUserRoles.users[0] could not be resolved for this community., an invalid date, or Update Default Leaderboard access through Leaderboard Settings (the Default Leaderboard's rank and view lists can only be changed in the dashboard). Nothing changed.VALIDATION_FAILEDFix the requestleaderboardID, a slug with capitals or spaces, a schedule change without startDate (detail names payload.duration.start), topRankOnly without a topRankLimit of 1 or more, or enableLeaderboardReset without leaderboardResetFrequency. detail names the field. Nothing changed.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 data02
Leaderboard not found: <id>). It may have been deleted, or belong to another community. Find the ID again with List leaderboards.Slug already exists: <slug>). Choose another slug.Retry with backoff03
displayOrder change is saved before the other fields, so read the leaderboard with Get leaderboard before you send it again.AUTH_API_KEY_VALIDATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 400,
"code": "VALIDATION_FAILED"
},
"message": "Validation failed",
"detail": {
"slug": "slug must contain only lowercase letters, numbers, and hyphens"
},
"solution": "Please check the request and try again"
}