Files
zkldi_Tachi/old-docs/docs/api/routes/admin.md
T
zk e363bd2532 docs: migrate from mkdocs to mdbook (#1558)
* docs: migrate from mkdocs to mdbook

- Rename old mkdocs docs/ to old-docs/ for reference
- Set up new docs/ with mdbook (book.toml + src/ tree)
- Mirror full nav structure from mkdocs.yml into SUMMARY.md
- Add Justfile-docs with docs-serve, docs-build, docs-check, docs-install recipes
- Import Justfile-docs from root Justfile
- Rewrite .github/workflows/docs.yml: build step uses taiki-e/install-action
  to install mdbook, split into separate build + deploy jobs, PR builds
  run the check step too

* ci(docs): pin actions to SHAs, install mdbook via release binary

* ci(docs): install mdbook from apt instead of curling a release binary

* dev: replace mkdocs python stack with mdbook in dev image

* ci(docs): apt only works on Debian; restore release binary install for Ubuntu CI

* docs: fix duplicate file entries in SUMMARY.md

* docs: remove docs-install recipe

* docs: remove site-url from book.toml to fix asset loading

* dev: install mdbook from upstream release binary, not Debian apt

The Debian package (0.4.x+ds) strips bundled font assets, leaving the
built site without fonts/fonts.css. Use the upstream tarball (same as CI)
so the theme is complete. Handles x86_64 and aarch64.

* docs: vendor mdbook tarballs in dev/mdbook/, install from there

Dockerfile.dev uses COPY + tar to install the right arch at build time.
CI extracts the x86_64 tarball directly from the checkout.
No network access required for either — and no stripped-fonts Debian package.

* fix: unwritten
2026-05-22 20:43:07 +01:00

225 lines
3.8 KiB
Markdown

# Admin Endpoints
These endpoints are for adminstrator use. As such, they all
require an `authLevel` of at least 3. For more information, see the [UserDocument](../../schemas/user.md).
*****
## Change Server Log Level
`POST /api/v1/admin/change-log-level`
### Permissions
- Admin
### Parameters
| Property | Type | Description |
| :: | :: | :: |
| `logLevel` | "crit" \| "severe" \| "warn" \| "info" \| "verbose" \| "debug" | The log level to change to. |
| `duration` | Number, Optional | How long to keep this change for in minutes. If not set, defaults to 60 minutes. |
| `noReset` | Boolean, Optional | If true, do not ever reset this log level change. |
### Response
Empty Object.
### Example
#### Request
```
POST /api/v1/admin/change-log-level
{
duration: 5,
logLevel: "verbose"
}
```
#### Response
Empty Object.
*****
## Delete any Score
This performs all the necessary checks to remove a score document aswell.
`POST /api/v1/admin/delete-score`
### Permissions
- Admin
### Parameters
| Property | Type | Description |
| :: | :: | :: |
| `scoreID` | String | The scoreID to delete. |
### Response
Empty Object.
*****
## Re-run PB processing for every scored user+chart (synchronous).
`POST /api/v1/admin/recalc-pbs`
Inserts every distinct `(user_id, chart_id)` from the **`score`** table into **`pb_dirty`**, then **drains** `pb_dirty` and downstream **`session_dirty`** / **`game_profile_dirty`** queues until nothing remains (same batching as the background worker, but the HTTP request waits until idle). Intended when PBs may be out of sync (e.g. after a bad migration). There is **no request body** and no filter-always all distinct pairs that appear on scores.
### Permissions
- Admin
### Parameters
None (send `{}` if your client requires a body).
### Response
Empty object (standard success wrapper with `body`).
### Example
#### Request
```
POST /api/v1/admin/recalc-pbs
```
```js
{}
```
#### Response
```js
{}
```
*****
## Destroy a users GPT Profile and forces a leaderboard recalc.
`POST /api/v1/admin/destroy-ugpt`
!!! warning
This is intended to completely remove a users GPT profile.
You should use this **only** if a user has irrevocably screwed
their account. Preferably early on!
### Permissions
- Admin
### Parameters
| Property | Type | Description |
| :: | :: | :: |
| `userID` | Integer | The user part of the UGPT. |
| `game` | Game | The game part of the UGPT. |
| `playtype` | Playtype | The PT part of the UGPT. Must be for the above game. |
### Response
Empty Object.
### Example
#### Request
```
POST /api/v1/admin/destroy-ugpt
```
```js
{
"userID": 1,
"game": "iidx",
"playtype": "DP"
}
```
#### Response
Empty Object.
*****
## Destroy a chart and all of its scores.
`POST /api/v1/admin/destroy-chart`
### Permissions
- Admin
### Parameters
| Property | Type | Description |
| :: | :: | :: |
| `chartID` | String | The chartID you wish to destroy. |
| `game` | Game | The game this chart belongs to (Necessary for lookups). |
### Response
Empty Object.
### Example
#### Request
```
POST /api/v1/admin/destroy-chart
```
```js
{
"chartID": "SomeChartID",
"game": "iidx"
}
```
#### Response
Empty Object.
*****
## Re-derive all scores site-wide (synchronous).
`POST /api/v1/admin/recalc`
Enqueues **every chart** into **`score_rederive`**, then **drains** `score_rederive` and downstream **`pb_dirty`**, **`session_dirty`**, and **`game_profile_dirty`** queues until nothing remains (the request waits until idle). Re-runs `scoreDeriver` and `scoreCalcs` for every score. There is **no request body** and no filter-always all charts.
### Permissions
- Admin
### Parameters
None (send an empty JSON object `{}` if your client requires a body).
### Response
Empty object (standard success wrapper with `body`).
### Example
#### Request
```
POST /api/v1/admin/recalc
```
```js
{}
```
#### Response
```js
{}
```