Skip to content

Leaderboard

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

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: namespace. Default: namespace.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

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

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

limit?integer

Rows per page, 1 to 100 (default 10).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
namespaces?string

Comma-separated namespaces; a single namespace with group_by

metrics*string

Comma-separated metrics

group_by?string

Metadata field to group entities by

weights?string

Metric weights as comma-separated key:value pairs (not with group_by, which sums the metrics)

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/aggregate?metrics=string"
{  "entries": [    {      "id": "string",      "meta": null,      "metrics": {        "property1": 0.1,        "property2": 0.1      },      "rank": 0,      "score": 0.1    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
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

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: metric. Default: metric.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

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    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 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

limit?integer

Rows per page, 1 to 100 (default 10).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
start_time?integer

Window start (Unix seconds); defaults to 24 hours before end_time

Formatint64
end_time?integer

Window end (Unix seconds); defaults to now

Formatint64
weights?string

Metric weights as comma-separated key:value pairs

Response Body

application/json

curl -X GET "https://example.com/api/v1/leaderboard/string/time-window"
{  "entries": [    {      "id": "string",      "meta": null,      "metrics": {        "property1": 0.1,        "property2": 0.1      },      "rank": 0,      "score": 0.1    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
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

Rows per page, 1 to 100 (default 10).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= 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"
{  "entries": [    {      "id": "string",      "meta": null,      "metrics": {        "property1": 0.1,        "property2": 0.1      },      "rank": 0,      "score": 0.1    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
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

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

Rows per page, 1 to 100 (default 10).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value

Response Body

application/json

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