Get the leaderboard by department
curl --request GET \
--url https://api.teambuilder.ge/v1/leaderboard/by-department \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.teambuilder.ge/v1/leaderboard/by-department', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.teambuilder.ge/v1/leaderboard/by-department"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"department": {
"id": "b3e1f7a2-6c4d-4e8f-9a1b-2c3d4e5f6a7b",
"external_id": "D-ENG",
"name": "Engineering"
},
"department_total_xp": 48210,
"member_count": 14,
"leaders": [
{
"rank": 3,
"employee_id": "8d2f6b1e-4c3a-4f5e-b7d9-1a2c3e4f5a6b",
"external_id": "EMP-00042",
"name": "Nino Beridze",
"department": {
"id": "b3e1f7a2-6c4d-4e8f-9a1b-2c3d4e5f6a7b",
"external_id": "D-ENG",
"name": "Engineering"
},
"level": 12,
"xp": 12450
}
]
}
],
"pagination": {
"next_cursor": null
}
}{
"error": {
"code": "validation_failed",
"message": "limit_per_department must not be greater than 25",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}{
"error": {
"code": "forbidden",
"message": "This API key lacks the required scope: leaderboard:read",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after 30 seconds.",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}Get the leaderboard by department
Each department’s top members for a period, with informational totals.
GET
/
v1
/
leaderboard
/
by-department
Get the leaderboard by department
curl --request GET \
--url https://api.teambuilder.ge/v1/leaderboard/by-department \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.teambuilder.ge/v1/leaderboard/by-department', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.teambuilder.ge/v1/leaderboard/by-department"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"department": {
"id": "b3e1f7a2-6c4d-4e8f-9a1b-2c3d4e5f6a7b",
"external_id": "D-ENG",
"name": "Engineering"
},
"department_total_xp": 48210,
"member_count": 14,
"leaders": [
{
"rank": 3,
"employee_id": "8d2f6b1e-4c3a-4f5e-b7d9-1a2c3e4f5a6b",
"external_id": "EMP-00042",
"name": "Nino Beridze",
"department": {
"id": "b3e1f7a2-6c4d-4e8f-9a1b-2c3d4e5f6a7b",
"external_id": "D-ENG",
"name": "Engineering"
},
"level": 12,
"xp": 12450
}
]
}
],
"pagination": {
"next_cursor": null
}
}{
"error": {
"code": "validation_failed",
"message": "limit_per_department must not be greater than 25",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}{
"error": {
"code": "forbidden",
"message": "This API key lacks the required scope: leaderboard:read",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after 30 seconds.",
"request_id": "req_7Hq2LmX9vT4kPz1RbN8sWc"
}
}Departments are listed by name, not ranked against each other. See Grouped by department.
Authorizations
API key — tb_live_… for production data, tb_test_… for the sandbox.
Query Parameters
The window XP is counted over. Months are calendar months in UTC.
all_time: all XP ever earned.this_month: XP earned since the 1st of the current month.last_3_months: XP earned in the current month and the two before it.last_year: XP earned in the current month and the eleven before it.
Available options:
all_time, this_month, last_3_months, last_year Example:
"this_month"
How many top members to list for each department, from 1 to 25.
Required range:
1 <= x <= 25Example:
3
Response
The departments and their leaders.
One entry per active department (empty ones included, plus any archived department that still has members), ordered by name ignoring case, then one for employees without a department if there are any.
Show child attributes
Show child attributes
Always a single page: next_cursor is always null.
Show child attributes
Show child attributes
Example:
{ "next_cursor": null }
