Internal and Config API
These routes are used by the Kōji web client and admin UI.
⚠️
These endpoints are implementation-facing. They are not part of the stable
public /api/v1 contract and may change between releases.
Auth Model
/api/v1/*:- Uses Bearer auth if
KOJI_SECRETis set. - Also accepts logged-in session cookie from
/config/login.
- Uses Bearer auth if
/internal/*:- Requires logged-in session cookie.
- Bearer token alone is not accepted.
Config Routes (/config)
| Method | Path | Purpose |
|---|---|---|
GET | /config/ | Returns runtime config (start coords, plugin lists, scanner type, login status, tile server, dangerous flag). |
POST | /config/login | Creates a logged-in session when { \"password\": KOJI_SECRET } matches. |
GET | /config/logout | Clears current session and redirects to /. |
GET | /config/nominatim?query=... | Nominatim search proxy (returns polygon/multipolygon results only). |
Internal Instance Routes (/internal/routes)
| Method | Path | Purpose |
|---|---|---|
GET | /internal/routes/from_scanner | List area/instance references from scanner/controller DB. |
GET | /internal/routes/from_koji | List geofence/route references from Kōji DB. |
GET | /internal/routes/one/{source}/{id}/{instance_type} | Load a single instance/route/geofence feature from scanner or Kōji source. |
Internal Data Routes (/internal/data)
category values: gym, pokestop, spawnpoint.
| Method | Path | Purpose |
|---|---|---|
POST | /internal/data/all/{category} | Return all points for category, filtered by request args (last_seen, tth). |
POST | /internal/data/bound/{category} | Return category points within lat/lon bounds. |
POST | /internal/data/area/{category} | Return category points for a provided/derived area. |
POST | /internal/data/area_stats/{category} | Return summarized area stats by category. |
Internal Admin Routes (/internal/admin)
Supported resource values: geofence, project, property, route, tileserver.
| Method | Path | Purpose |
|---|---|---|
GET | /internal/admin/{resource}/ | Paginated list. |
GET | /internal/admin/{resource}/all/ | Unpaginated JSON cache list. |
GET | /internal/admin/{resource}/{id}/ | Get one item by id. |
POST | /internal/admin/{resource}/ | Create resource. |
PATCH | /internal/admin/{resource}/{id}/ | Update resource. |
DELETE | /internal/admin/{resource}/{id}/ | Delete resource. |
GET | /internal/admin/search/{resource}/?query=... | Search by query text. |
Relationship Helpers
| Method | Path | Purpose |
|---|---|---|
GET | /internal/admin/{resource}/parent | Unique parent list (geofence and route resources). |
PATCH | /internal/admin/assign/geofence/{property}/{id}/ | Assign relationship payload for geofence. |
Geofence/Project Mapping (/internal/admin/geofence_project)
| Method | Path | Purpose |
|---|---|---|
GET | /internal/admin/geofence_project/all/ | List mapping rows. |
POST | /internal/admin/geofence_project/ | Create one mapping row. |
PATCH | /internal/admin/geofence_project/ | Update mapping by geofence/project ids. |
PATCH | /internal/admin/geofence_project/{table}/{id}/ | Bulk update by table (geofence or project) and id. |
DELETE | /internal/admin/geofence_project/ | Delete mapping by geofence/project ids. |
Last updated on