Console
Leaderboards

Score

Set, add to, reset, or remove a user's score on a leaderboard. Call from your game server after match-end or milestone events.

POST /api/leaderboards/score.php
Requires Authorization: AppID:AppKey header

Identify the leaderboard (one of)

FieldTypeDescription
slugstringLeaderboard slug from your app
leaderboard_idintNumeric ID returned by create.php

Identify the user (one of)

FieldTypeDescription
user_idintNumeric user ID
userkeystringUser's userKey
tokenstringUser's session token

Action

actionvalueDescription
setrequiredSet an absolute score, replacing the current value
addrequiredIncrement the score. Use a negative number to subtract.
resetSet the score to 0 (user remains on the leaderboard)
removeRemove the user entirely from the leaderboard

Success response 200

{
  "success": true,
  "action": "add",
  "leaderboard_id": 1,
  "user_id": 42,
  "new_score": 47
}

Errors

CodeMessageCause
400Leaderboard identifier required.Neither slug nor leaderboard_id provided
400User identifier required.No user identification field
400value is required for this action.set or add without value
404Leaderboard not found.Slug/ID doesn't exist for this app