Skip to main content
View as Markdown

Leaderboard Entity & CRUD - Gamification

Leaderboard Entity & CRUD​

Leaderboards track user scores and rank users. They are scoped to virtual events via virtualEventIds.

4.1 Leaderboard Entity​

FieldTypeDescription
idstringAuto-generated unique identifier (read-only)
namestringLeaderboard display name
descriptionstringDescription text
statusstringscheduled, enabled, disabled
startDateISO 8601Scoring window start
endDateISO 8601Scoring window end
virtualEventIdsint[]Virtual event IDs this leaderboard applies to
participationPolicyobjectControls user visibility (see section 5)
subLeaderboardsarraySegments for team/regional rankings (see section 4.4)

Status lifecycle: scheduled → enabled → disabled. Create leaderboards as scheduled, then update to enabled when the event starts.

4.2 Create Leaderboard​

Parameters

ParameterTypeRequiredDescription
objectTypestringYesAlways "Leaderboard"
namestringYesLeaderboard display name
descriptionstringNoDescription text
statusstringYesInitial status: "scheduled", "enabled", or "disabled"
startDatestringYesScoring window start in ISO 8601 format
endDatestringYesScoring window end in ISO 8601 format
virtualEventIdsarrayYesArray of virtual event ID strings this leaderboard applies to
participationPolicyobjectNoControls user visibility (see section 5). Default: all users visible
participationPolicy.userDefaultPolicystringNoDefault policy: "display", "do_not_display", or "do_not_save"
participationPolicy.policiesarrayNoArray of policy override objects with policy, matchCriteria, and values
subLeaderboardsarrayNoSegment definitions for team/regional rankings (see section 4.4)
curl -X POST "$KALTURA_SCM_URL/leaderboard/create" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"objectType": "Leaderboard",
"name": "Conference Engagement",
"description": "Points for session attendance, polls, and chat",
"status": "scheduled",
"startDate": "2025-06-01T09:00:00.000Z",
"endDate": "2025-06-03T18:00:00.000Z",
"participationPolicy": {
"userDefaultPolicy": "display",
"policies": []
},
"virtualEventIds": ["$VIRTUAL_EVENT_ID"]
}'

Response

{
"id": "lb_abc123",
"name": "Conference Engagement",
"description": "Points for session attendance, polls, and chat",
"status": "scheduled",
"startDate": "2025-06-01T09:00:00.000Z",
"endDate": "2025-06-03T18:00:00.000Z",
"participationPolicy": {
"userDefaultPolicy": "display",
"policies": []
},
"virtualEventIds": ["12345"],
"createdAt": "2025-05-20T10:00:00.000Z",
"updatedAt": "2025-05-20T10:00:00.000Z"
}

4.3 Get, Update, List, Delete​

# Get
curl -X POST "$KALTURA_SCM_URL/leaderboard/get" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"id": "'$LEADERBOARD_ID'"}'

# Update (enable when event starts)
curl -X POST "$KALTURA_SCM_URL/leaderboard/update" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"id": "'$LEADERBOARD_ID'", "status": "enabled"}'

# List (paginated)
curl -X POST "$KALTURA_SCM_URL/leaderboard/list" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"pager": {"pageSize": 10, "pageIndex": 1}}'

# Delete
curl -X POST "$KALTURA_SCM_URL/leaderboard/delete" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"id": "'$LEADERBOARD_ID'"}'

4.4 Sub-Leaderboards​

Segment users by properties (country, company, department) for team-based or regional competitions.

curl -X POST "$KALTURA_SCM_URL/leaderboard/create" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"objectType": "Leaderboard",
"name": "Regional Competition",
"status": "scheduled",
"startDate": "2025-06-01T00:00:00Z",
"endDate": "2025-06-02T00:00:00Z",
"participationPolicy": {"userDefaultPolicy": "display", "policies": []},
"virtualEventIds": ["$VIRTUAL_EVENT_ID"],
"subLeaderboards": [
{"name": "By Country", "filterPaths": ["country"], "id": 0},
{"name": "By Company", "filterPaths": ["company"], "id": 1}
]
}'

filterPaths references user profile properties from the User Profile API. Individual scores automatically aggregate within their sub-leaderboard segment.