Getting started
Quickstart
Award XP from a Roblox game server in about ten lines of Luau.
The shortest path from nothing to a working call: create a key, enable HTTP requests in your game, award some XP.
Every URL and header on this page is a placeholder. The base URL, the auth header name and the key format are all still open. This page teaches the shape of a call, not its literal contents.
Before you start
You need:
- A clan you own, on the dashboard
- Its clan ID — TODO: document where this is surfaced in clan settings
- A clan API key — TODO: the key creation UI is not built yet; see Authentication
1. Enable HTTP requests
In Roblox Studio: Game Settings → Security → Allow HTTP Requests.
This is the single most common reason a first call fails.
HttpServicethrows immediately when it is off, and the error does not mention the setting.
2. Make the call
local HttpService = game:GetService("HttpService")
-- TODO: real base URL undecided.
local BASE_URL = "https://API_BASE_URL/v0"
local response = HttpService:RequestAsync({
Url = BASE_URL .. "/clans/CLAN_ID/members/ROBLOX_ID/xp",
Method = "POST",
Headers = {
-- TODO: header name undecided — `api-key` vs `Authorization: Bearer`.
["Authorization"] = "Bearer YOUR_CLAN_API_KEY",
["Content-Type"] = "application/json",
},
Body = HttpService:JSONEncode({
amount = 150,
reason = "Round win",
}),
})
if response.Success then
print(HttpService:JSONDecode(response.Body))
else
warn("Award failed:", response.StatusCode, response.Body)
end
HttpServiceonly works from server scripts. ALocalScriptcannot reach this API — and more importantly, a key that reaches the client is a key that has been leaked. Store it server-side and never pass it down.
3. Check the response
A successful award returns the member's updated state:
{
"robloxId": "ROBLOX_ID",
"xp": "4200",
"rank": "Sergeant"
}TODO: confirm the real response shape. XP is a BigInt server-side and comes
back as a decimal string on the existing session-auth routes; the public API
should match, but that is not yet decided.
Common failures
| Symptom | Cause |
|---|---|
Http requests are not enabled | Step 1 was skipped |
401 | Key missing, malformed, or revoked |
403 | The key belongs to a different clan than the one in the path |
404 | Wrong clan ID, or the member does not exist and the clan is not an Auto Clan |
429 | Rate limited — see Rate limits |
Next
- Authentication — how keys are scoped
- Errors — the full status code list