Delete a leaderboard
Permanently delete one leaderboard in the community that owns your API key.
- Method
- DELETE
- Path
https://api.returning.ai / v1/ leaderboards/ {leaderboardID} - Permission
- leaderboard
- Retries
- No Idempotency-Key; check with Get leaderboard first
When to use this
- Remove a test leaderboard you created while building your integration.
- Clean up a finished competition you no longer want traders to see.
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 you can only delete leaderboards in that community.
Behaviour#
The leaderboard is removed straight away and can't be restored. Leaderboards after it in your display order move up one place to close the gap.
Your community's Default Leaderboard can't be deleted. Check kind with Get leaderboard: only custom leaderboards can be deleted.
Request#
Path parameters#
_id, from List leaderboards or Create leaderboard.Rule24-character hex ID
Eg66f000000000000000000301
Headers#
leaderboard.RuleBearer <API_KEY>
curl --request DELETE \
--url https://api.returning.ai/v1/leaderboards/66f000000000000000000301 \
--header 'Authorization: Bearer <API_KEY>'
Response#
A 200 returns the deleted leaderboard's ID as a string in data. Branch on the HTTP status.
{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Delete leaderboard success.",
"data": "66f000000000000000000301"
}
Errors#
401, 403 and 400 VALIDATION_FAILED errors carry a code in meta.code. Other errors have no code; branch on the HTTP status and read detail. An ID that doesn't match a leaderboard in your community returns 500, not 404.
Fix the request04
leaderboard (meta.code is AUTH_PERMISSION_REQUIRED). Add the permission in Settings > Integration > API Keys.VALIDATION_FAILEDFix the requestleaderboardID isn't a 24-character hex ID. detail names it. Nothing was deleted.AUTH_API_KEY_REQUIREDFix the requestAuthorization: Bearer <API_KEY>.AUTH_API_KEY_INVALIDFix the requestFix the data01
detail is The Default Leaderboard cannot be deleted. Your community's built-in leaderboard (kind default) can't be deleted; switch it off with Update an existing leaderboard instead.Retry with backoff03
500, not 404). List leaderboards to check the ID before you retry.AUTH_API_KEY_VALIDATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 403,
"code": "AUTH_PERMISSION_REQUIRED"
},
"message": "Insufficient API key permissions",
"detail": "API key is missing required permissions: leaderboard",
"solution": "Update the API key permissions or use a key with the required permissions"
}