Skip to content

Get Campaign Leaderboard

GET /v1/campaigns/{slug}/leaderboard

Returns the campaign leaderboard ranked by total points. Useful for displaying rankings in your app or verifying participant standings.

HeaderRequiredValue
X-API-SecretYesYour secret key
ParameterTypeDefaultDescription
limitinteger20Number of entries to return (max 100)
Terminal window
curl -X GET "https://api.gamifyhost.com/v1/campaigns/summer-promo/leaderboard?limit=10" \
-H "X-API-Secret: sk_live_your_secret_key"

Status: 200 OK

{
"status": "success",
"data": {
"entries": [
{
"rank": 1,
"userId": "user_abc",
"displayName": "Alice",
"totalPoints": 2500,
"eventsCount": 12
},
{
"rank": 2,
"userId": "user_def",
"displayName": "Bob",
"totalPoints": 1800,
"eventsCount": 8
}
],
"totalParticipants": 156
}
}
FieldTypeDescription
entriesarrayRanked list of participants
entries[].rankintegerPosition on the leaderboard
entries[].userIdstringUser’s external ID
entries[].displayNamestringUser’s display name
entries[].totalPointsintegerTotal points earned in this campaign
entries[].eventsCountintegerNumber of events recorded
totalParticipantsintegerTotal campaign participants