Getting started
Make a key, check it works, and read your first leaderboard.
1. Make a key
- Open the dashboard and go to Settings → Integrations → Developer API. You need to be the server's owner, a co-owner, or in a group with the Developer API keys permission.
- Under Make a key, give it a name you'll recognise ("Website leaderboard") and tick what it can do.
- Copy the key. Kuma shows it once. If you lose it, give the key a new secret or make another.
| Scope | Allows |
|---|---|
server:read | The server's name, platform, member count and which Kuma features are on. |
levels:read | The XP leaderboard and any member's level, XP and rank. |
economy:read | The coin leaderboard and any member's balance and daily streak. |
cases:read | The server's moderation cases: who, what, why, by whom and their status. |
economy:write writes | Add coins to or remove coins from any member's balance, up to the key's daily limit. |
levels:write writes | Add XP to any member, up to the key's daily limit. Level-ups give level roles and badges as usual. |
2. Check it works
GET /v1/key needs no scope. It tells you the key's server id (you'll need it in every other path), what the key can do right now, and whether the API is on for that server.
export KUMA_KEY="kuma_sk_…"
curl https://api.kumabot.xyz/v1/key -H "Authorization: Bearer $KUMA_KEY"{
"id": "key_3f9a1c2b7d4e5f60",
"name": "Website leaderboard",
"server_id": "01HQ8…",
"scopes": ["levels:read", "server:read"],
"active_scopes": ["levels:read", "server:read"],
"api_available": true,
"created_at": "2026-11-20T18:04:11.000Z",
"rate_limit": { "per_minute": 120, "server_per_minute": 300 }
}3. Read the leaderboard
// Node 18+ (fetch is built in)
const API = "https://api.kumabot.xyz/v1";
const headers = { Authorization: `Bearer ${process.env.KUMA_KEY}` };
const key = await (await fetch(`${API}/key`, { headers })).json();
const res = await fetch(`${API}/servers/${key.server_id}/levels/leaderboard?limit=10`, { headers });
if (!res.ok) throw new Error((await res.json()).error.message);
for (const row of (await res.json()).data) {
console.log(`#${row.rank} ${row.user.username ?? row.user.id}: level ${row.level}`);
}import os, requests
API = "https://api.kumabot.xyz/v1"
headers = {"Authorization": f"Bearer {os.environ['KUMA_KEY']}"}
server_id = requests.get(f"{API}/key", headers=headers).json()["server_id"]
res = requests.get(f"{API}/servers/{server_id}/levels/leaderboard", params={"limit": 10}, headers=headers)
res.raise_for_status()
for row in res.json()["data"]:
print(f"#{row['rank']} {row['user']['username'] or row['user']['id']}: level {row['level']}")Good to know
- Ids are the platform's own (Stoat, Discord or Fluxer) and always strings. Case numbers are integers.
- Names are the ones Kuma last saw, so they can be out of date or
null: fall back to the id. - Lists come in pages: pass
next_cursorback ascursoruntil it'snull. - The API reference lists every endpoint and field. The machine-readable spec is at
/v1/openapi.json, for generating a client.