From 0d218534929309def9d9d4d5475fcad03145a911 Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Sun, 4 Oct 2026 22:27:39 +0100 Subject: [PATCH] add player admin api reference docs and bruno collection --- content/docs/1.x/admin/bruno-collection.mdx | 2 +- content/docs/1.x/admin/meta.json | 2 +- content/docs/1.x/admin/player-api.mdx | 94 +++++++++++++++++++++ public/bruno-collection.html | 3 +- 4 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 content/docs/1.x/admin/player-api.mdx diff --git a/content/docs/1.x/admin/bruno-collection.mdx b/content/docs/1.x/admin/bruno-collection.mdx index 91dbeb0..8b83496 100644 --- a/content/docs/1.x/admin/bruno-collection.mdx +++ b/content/docs/1.x/admin/bruno-collection.mdx @@ -27,7 +27,7 @@ The full collection is available in [this repository](https://github.com/TaloDev ## Collection structure -The collection's **Admin API** folder contains **Game config**, **Leaderboards** and **Stats** requests, mirroring the endpoints documented in the [Admin API reference](/1.x/admin/authentication). +The collection's **Admin API** folder contains **Game config**, **Leaderboards**, **Players** and **Stats** requests, mirroring the endpoints documented in the [Admin API reference](/1.x/admin/authentication). ## Configure the environment diff --git a/content/docs/1.x/admin/meta.json b/content/docs/1.x/admin/meta.json index a1f90a1..c8e0dda 100644 --- a/content/docs/1.x/admin/meta.json +++ b/content/docs/1.x/admin/meta.json @@ -1,5 +1,5 @@ { - "pages": ["authentication", "common-errors", "dev-data", "bruno-collection", "game-config-api", "game-stat-api", "leaderboard-api"], + "pages": ["authentication", "common-errors", "dev-data", "bruno-collection", "game-config-api", "game-stat-api", "leaderboard-api", "player-api"], "title": "Admin API reference", "icon": "admin" } diff --git a/content/docs/1.x/admin/player-api.mdx b/content/docs/1.x/admin/player-api.mdx new file mode 100644 index 0000000..309d082 --- /dev/null +++ b/content/docs/1.x/admin/player-api.mdx @@ -0,0 +1,94 @@ +--- +description: Manage players via the admin API. Search for players, update and delete them. +title: Player admin API +seoTitle: Admin players API +--- + +import { ServiceDocumentation } from '@/components/documentation/ServiceDocumentation' +import { generateServiceTOC } from '@/lib/api-docs' + +export const service = 'PlayerAdminAPI' + +export const pageToc = [ + { title: 'Overview', url: '#overview', depth: 2 }, + { title: 'Endpoints', url: '#endpoints', depth: 2 }, + ...generateServiceTOC(service), + { title: 'Types', url: '#types', depth: 2 }, + { title: 'Player', url: '#player', depth: 3 }, + { title: 'PlayerAlias', url: '#playeralias', depth: 3 }, + { title: 'Prop', url: '#prop', depth: 3 }, + { title: 'RejectedProp', url: '#rejectedprop', depth: 3 }, +] + +## Overview + +The player admin API lets you search for and read [players](/1.x/http/player-api) programmatically, as well as update their props and completely delete them. + +## Endpoints + + + +## Types + +### Player + +```ts +type Player = { + id: string + props: Prop[] + aliases: PlayerAlias[] + devBuild: boolean + createdAt: string + lastSeenAt: string + groups: { + id: string + name: string + }[] +} +``` + +### PlayerAlias + +Each alias includes the player it belongs to, without its aliases to avoid a circular reference. + +```ts +type PlayerAlias = { + id: number + service: string + identifier: string + displayName: string + player: Player + lastSeenAt: string + createdAt: string + updatedAt: string +} +``` + +### Prop + +```ts +type Prop = { + key: string + value: string +} +``` + +### RejectedProp + +Props that could not be saved are returned in `rejectedProps` when [updating a player](/1.x/admin/player-api#update-a-players-props-or-dev-build-status). + +```ts +type RejectedProp = { + key: string + error: + | 'PROP_KEY_TOO_LONG' + | 'PROP_VALUE_TOO_LONG' + | 'PROP_ARRAY_TOO_LONG' + | 'PROP_CONTAINS_PROFANITY' + | 'PROP_KEY_RESERVED' + message: string +} +``` diff --git a/public/bruno-collection.html b/public/bruno-collection.html index a61e73f..24f90d1 100644 --- a/public/bruno-collection.html +++ b/public/bruno-collection.html @@ -14,10 +14,11 @@