Update a leaderboard
curl --request PATCH \
--url https://api.engagefabric.com/projects/{projectId}/leaderboards/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Weekly XP Champions",
"description": "Top players by XP earned this week",
"type": "GLOBAL",
"metric": "xp",
"sortOrder": "DESC",
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-01-31T23:59:59Z",
"segmentField": "metadata.region",
"maxEntries": 1000,
"minScore": 0,
"showTopN": 100,
"iconUrl": "https://cdn.example.com/icons/trophy.png",
"metadata": {
"theme": "gold",
"category": "competitive"
},
"isActive": true
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}"
payload = {
"name": "Weekly XP Champions",
"description": "Top players by XP earned this week",
"type": "GLOBAL",
"metric": "xp",
"sortOrder": "DESC",
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-01-31T23:59:59Z",
"segmentField": "metadata.region",
"maxEntries": 1000,
"minScore": 0,
"showTopN": 100,
"iconUrl": "https://cdn.example.com/icons/trophy.png",
"metadata": {
"theme": "gold",
"category": "competitive"
},
"isActive": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weekly XP Champions',
description: 'Top players by XP earned this week',
type: 'GLOBAL',
metric: 'xp',
sortOrder: 'DESC',
startDate: '2025-01-01T00:00:00Z',
endDate: '2025-01-31T23:59:59Z',
segmentField: 'metadata.region',
maxEntries: 1000,
minScore: 0,
showTopN: 100,
iconUrl: 'https://cdn.example.com/icons/trophy.png',
metadata: {theme: 'gold', category: 'competitive'},
isActive: true
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Weekly XP Champions',
'description' => 'Top players by XP earned this week',
'type' => 'GLOBAL',
'metric' => 'xp',
'sortOrder' => 'DESC',
'startDate' => '2025-01-01T00:00:00Z',
'endDate' => '2025-01-31T23:59:59Z',
'segmentField' => 'metadata.region',
'maxEntries' => 1000,
'minScore' => 0,
'showTopN' => 100,
'iconUrl' => 'https://cdn.example.com/icons/trophy.png',
'metadata' => [
'theme' => 'gold',
'category' => 'competitive'
],
'isActive' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}"
payload := strings.NewReader("{\n \"name\": \"Weekly XP Champions\",\n \"description\": \"Top players by XP earned this week\",\n \"type\": \"GLOBAL\",\n \"metric\": \"xp\",\n \"sortOrder\": \"DESC\",\n \"startDate\": \"2025-01-01T00:00:00Z\",\n \"endDate\": \"2025-01-31T23:59:59Z\",\n \"segmentField\": \"metadata.region\",\n \"maxEntries\": 1000,\n \"minScore\": 0,\n \"showTopN\": 100,\n \"iconUrl\": \"https://cdn.example.com/icons/trophy.png\",\n \"metadata\": {\n \"theme\": \"gold\",\n \"category\": \"competitive\"\n },\n \"isActive\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weekly XP Champions\",\n \"description\": \"Top players by XP earned this week\",\n \"type\": \"GLOBAL\",\n \"metric\": \"xp\",\n \"sortOrder\": \"DESC\",\n \"startDate\": \"2025-01-01T00:00:00Z\",\n \"endDate\": \"2025-01-31T23:59:59Z\",\n \"segmentField\": \"metadata.region\",\n \"maxEntries\": 1000,\n \"minScore\": 0,\n \"showTopN\": 100,\n \"iconUrl\": \"https://cdn.example.com/icons/trophy.png\",\n \"metadata\": {\n \"theme\": \"gold\",\n \"category\": \"competitive\"\n },\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Weekly XP Champions\",\n \"description\": \"Top players by XP earned this week\",\n \"type\": \"GLOBAL\",\n \"metric\": \"xp\",\n \"sortOrder\": \"DESC\",\n \"startDate\": \"2025-01-01T00:00:00Z\",\n \"endDate\": \"2025-01-31T23:59:59Z\",\n \"segmentField\": \"metadata.region\",\n \"maxEntries\": 1000,\n \"minScore\": 0,\n \"showTopN\": 100,\n \"iconUrl\": \"https://cdn.example.com/icons/trophy.png\",\n \"metadata\": {\n \"theme\": \"gold\",\n \"category\": \"competitive\"\n },\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_bodyLeaderboards
Update a leaderboard
PATCH
/
projects
/
{projectId}
/
leaderboards
/
{id}
Update a leaderboard
curl --request PATCH \
--url https://api.engagefabric.com/projects/{projectId}/leaderboards/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Weekly XP Champions",
"description": "Top players by XP earned this week",
"type": "GLOBAL",
"metric": "xp",
"sortOrder": "DESC",
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-01-31T23:59:59Z",
"segmentField": "metadata.region",
"maxEntries": 1000,
"minScore": 0,
"showTopN": 100,
"iconUrl": "https://cdn.example.com/icons/trophy.png",
"metadata": {
"theme": "gold",
"category": "competitive"
},
"isActive": true
}
'import requests
url = "https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}"
payload = {
"name": "Weekly XP Champions",
"description": "Top players by XP earned this week",
"type": "GLOBAL",
"metric": "xp",
"sortOrder": "DESC",
"startDate": "2025-01-01T00:00:00Z",
"endDate": "2025-01-31T23:59:59Z",
"segmentField": "metadata.region",
"maxEntries": 1000,
"minScore": 0,
"showTopN": 100,
"iconUrl": "https://cdn.example.com/icons/trophy.png",
"metadata": {
"theme": "gold",
"category": "competitive"
},
"isActive": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weekly XP Champions',
description: 'Top players by XP earned this week',
type: 'GLOBAL',
metric: 'xp',
sortOrder: 'DESC',
startDate: '2025-01-01T00:00:00Z',
endDate: '2025-01-31T23:59:59Z',
segmentField: 'metadata.region',
maxEntries: 1000,
minScore: 0,
showTopN: 100,
iconUrl: 'https://cdn.example.com/icons/trophy.png',
metadata: {theme: 'gold', category: 'competitive'},
isActive: true
})
};
fetch('https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Weekly XP Champions',
'description' => 'Top players by XP earned this week',
'type' => 'GLOBAL',
'metric' => 'xp',
'sortOrder' => 'DESC',
'startDate' => '2025-01-01T00:00:00Z',
'endDate' => '2025-01-31T23:59:59Z',
'segmentField' => 'metadata.region',
'maxEntries' => 1000,
'minScore' => 0,
'showTopN' => 100,
'iconUrl' => 'https://cdn.example.com/icons/trophy.png',
'metadata' => [
'theme' => 'gold',
'category' => 'competitive'
],
'isActive' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}"
payload := strings.NewReader("{\n \"name\": \"Weekly XP Champions\",\n \"description\": \"Top players by XP earned this week\",\n \"type\": \"GLOBAL\",\n \"metric\": \"xp\",\n \"sortOrder\": \"DESC\",\n \"startDate\": \"2025-01-01T00:00:00Z\",\n \"endDate\": \"2025-01-31T23:59:59Z\",\n \"segmentField\": \"metadata.region\",\n \"maxEntries\": 1000,\n \"minScore\": 0,\n \"showTopN\": 100,\n \"iconUrl\": \"https://cdn.example.com/icons/trophy.png\",\n \"metadata\": {\n \"theme\": \"gold\",\n \"category\": \"competitive\"\n },\n \"isActive\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weekly XP Champions\",\n \"description\": \"Top players by XP earned this week\",\n \"type\": \"GLOBAL\",\n \"metric\": \"xp\",\n \"sortOrder\": \"DESC\",\n \"startDate\": \"2025-01-01T00:00:00Z\",\n \"endDate\": \"2025-01-31T23:59:59Z\",\n \"segmentField\": \"metadata.region\",\n \"maxEntries\": 1000,\n \"minScore\": 0,\n \"showTopN\": 100,\n \"iconUrl\": \"https://cdn.example.com/icons/trophy.png\",\n \"metadata\": {\n \"theme\": \"gold\",\n \"category\": \"competitive\"\n },\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/projects/{projectId}/leaderboards/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Weekly XP Champions\",\n \"description\": \"Top players by XP earned this week\",\n \"type\": \"GLOBAL\",\n \"metric\": \"xp\",\n \"sortOrder\": \"DESC\",\n \"startDate\": \"2025-01-01T00:00:00Z\",\n \"endDate\": \"2025-01-31T23:59:59Z\",\n \"segmentField\": \"metadata.region\",\n \"maxEntries\": 1000,\n \"minScore\": 0,\n \"showTopN\": 100,\n \"iconUrl\": \"https://cdn.example.com/icons/trophy.png\",\n \"metadata\": {\n \"theme\": \"gold\",\n \"category\": \"competitive\"\n },\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Leaderboard name
Maximum string length:
255Example:
"Weekly XP Champions"
Leaderboard description
Example:
"Top players by XP earned this week"
Leaderboard type
Available options:
GLOBAL, SEGMENTED, TIME_BOXED, SEASONAL Metric to rank by (e.g., "xp", "wins", "points")
Maximum string length:
100Example:
"xp"
Sort order for rankings
Available options:
ASC, DESC Start date for time-boxed leaderboards
Example:
"2025-01-01T00:00:00Z"
End date for time-boxed leaderboards
Example:
"2025-01-31T23:59:59Z"
Reset schedule for recurring leaderboards
Available options:
DAILY, WEEKLY, MONTHLY, SEASONAL Field to segment by (e.g., "metadata.region")
Maximum string length:
255Example:
"metadata.region"
Maximum entries to track
Required range:
10 <= x <= 100000Minimum score to appear on leaderboard
Example:
0
Number of top entries to show by default
Required range:
1 <= x <= 1000Icon URL for the leaderboard
Example:
"https://cdn.example.com/icons/trophy.png"
Additional metadata
Example:
{
"theme": "gold",
"category": "competitive"
}
Leaderboard status
Available options:
DRAFT, ACTIVE, PAUSED, ARCHIVED Whether the leaderboard is active
Response
Leaderboard updated
⌘I
