Kuma for developers Early access API reference Manage keys

Getting started

Make a key, check it works, and read your first leaderboard.

1. Make a key

  1. 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.
  2. Under Make a key, give it a name you'll recognise ("Website leaderboard") and tick what it can do.
  3. Copy the key. Kuma shows it once. If you lose it, give the key a new secret or make another.
ScopeAllows
server:readThe server's name, platform, member count and which Kuma features are on.
levels:readThe XP leaderboard and any member's level, XP and rank.
economy:readThe coin leaderboard and any member's balance and daily streak.
cases:readThe server's moderation cases: who, what, why, by whom and their status.
economy:write writesAdd coins to or remove coins from any member's balance, up to the key's daily limit.
levels:write writesAdd 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.

Request
export KUMA_KEY="kuma_sk_…"
curl https://api.kumabot.xyz/v1/key -H "Authorization: Bearer $KUMA_KEY"
Response
{
  "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

JavaScript
// 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}`);
}
Python
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