HTTP API

Leaderboard

GET/api/v1/leaderboard
GET
/api/v1/leaderboard

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard"
{  "namespaces": [    {      "entity_count": 0,      "last_updated": 0,      "metrics": [        "string"      ],      "namespace": "string"    }  ]}
GET/api/v1/leaderboard/aggregate
GET
/api/v1/leaderboard/aggregate

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

namespaces?string

Comma-separated list of namespaces

metrics*string

Comma-separated list of metrics

group_by?string

Metadata field to group by

limit?integer

Number of entries to return

Range0 <= value
offset?integer

Offset for pagination

Range0 <= value
weights?string

Metric weights

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/aggregate?metrics=string"
[  {    "id": "string",    "meta": null,    "metrics": {      "property1": 0.1,      "property2": 0.1    },    "rank": 0,    "score": 0.1  }]
POST/api/v1/leaderboard/{namespace}
POST
/api/v1/leaderboard/{namespace}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Submission to create or update leaderboard entries

Response Body

application/json

curl -X POST "https://example.com/api/v1/leaderboard/string" \  -H "Content-Type: application/json" \  -d '{    "metrics": {      "property1": 0.1,      "property2": 0.1    }  }'
{  "id": "string",  "rank": 0,  "total_entities": 0,  "weighted_score": 0.1}
DELETE/api/v1/leaderboard/{namespace}
DELETE
/api/v1/leaderboard/{namespace}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace to delete

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/leaderboard/string"
{  "message": "string",  "ok": true}
GET/api/v1/leaderboard/{namespace}/around/{id}
GET
/api/v1/leaderboard/{namespace}/around/{id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

id*string

Entity ID

Query Parameters

window?integer

Number of entries above and below to return

Range0 <= value
weights?string

Metric weights as comma-separated key:value pairs

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/around/string"
[  {    "id": "string",    "meta": null,    "metrics": {      "property1": 0.1,      "property2": 0.1    },    "rank": 0,    "score": 0.1  }]
POST/api/v1/leaderboard/{namespace}/batch
POST
/api/v1/leaderboard/{namespace}/batch

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A batch of score submissions for one namespace. Each entry's id is required (there is no per-request principal default in batch mode). Entries are applied independently and fail-fast; the server enforces a per-batch cap.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leaderboard/string/batch" \  -H "Content-Type: application/json" \  -d '{    "entries": [      {        "metrics": {          "property1": 0.1,          "property2": 0.1        }      }    ]  }'
{  "count": 0,  "results": [    {      "id": "string",      "rank": 0,      "total_entities": 0,      "weighted_score": 0.1    }  ]}
GET/api/v1/leaderboard/{namespace}/meta/{id}
GET
/api/v1/leaderboard/{namespace}/meta/{id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

id*string

Entity ID

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/meta/string"
null
GET/api/v1/leaderboard/{namespace}/metrics
GET
/api/v1/leaderboard/{namespace}/metrics

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/metrics"
{  "metrics": [    {      "avg": 0,      "entity_count": 0,      "max": 0,      "metric": "string",      "min": 0    }  ]}
DELETE/api/v1/leaderboard/{namespace}/metrics/{metric}
DELETE
/api/v1/leaderboard/{namespace}/metrics/{metric}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

metric*string

Metric name to delete

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/leaderboard/string/metrics/string"
{  "message": "string",  "ok": true}
GET/api/v1/leaderboard/{namespace}/time-window
GET
/api/v1/leaderboard/{namespace}/time-window

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

Query Parameters

start_time?integer

Start timestamp (Unix epoch)

Formatint64
end_time?integer

End timestamp (Unix epoch)

Formatint64
limit?integer

Number of entries to return

Range0 <= value
offset?integer

Offset for pagination

Range0 <= value
weights?string

Metric weights as comma-separated metric:weight pairs

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/time-window"
[  {    "id": "string",    "meta": null,    "metrics": {      "property1": 0.1,      "property2": 0.1    },    "rank": 0,    "score": 0.1  }]
GET/api/v1/leaderboard/{namespace}/top
GET
/api/v1/leaderboard/{namespace}/top

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

Query Parameters

limit?integer

Number of entries to return

Range0 <= value
offset?integer

Offset for pagination (default: 0)

Range0 <= value
weights?string

Metric weights as comma-separated key:value pairs Example: "kills:1.0,accuracy:0.5"

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/top"
[  {    "id": "string",    "meta": null,    "metrics": {      "property1": 0.1,      "property2": 0.1    },    "rank": 0,    "score": 0.1  }]
GET/api/v1/leaderboard/{namespace}/{id}
GET
/api/v1/leaderboard/{namespace}/{id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

id*string

Entity ID

Query Parameters

limit?integer

Number of entries to return

Range0 <= value
offset?integer

Offset for pagination (default: 0)

Range0 <= value
weights?string

Metric weights as comma-separated key:value pairs Example: "kills:1.0,accuracy:0.5"

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/string"
null
DELETE/api/v1/leaderboard/{namespace}/{id}
DELETE
/api/v1/leaderboard/{namespace}/{id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

id*string

Entity ID to delete

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/leaderboard/string/string"
{  "message": "string",  "ok": true}
GET/api/v1/leaderboard/{namespace}/{metric}/top
GET
/api/v1/leaderboard/{namespace}/{metric}/top

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Leaderboard namespace

metric*string

Metric name

Query Parameters

limit?integer

Number of entries to return

Range0 <= value
offset?integer

Offset for pagination (default: 0)

Range0 <= value
weights?string

Metric weights as comma-separated key:value pairs Example: "kills:1.0,accuracy:0.5"

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/string/top"
[  {    "id": "string",    "meta": null,    "metrics": {      "property1": 0.1,      "property2": 0.1    },    "rank": 0,    "score": 0.1  }]

On this page