Skip to Content
API ReferenceInternal and Config API

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_SECRET is set.
    • Also accepts logged-in session cookie from /config/login.
  • /internal/*:
    • Requires logged-in session cookie.
    • Bearer token alone is not accepted.

Config Routes (/config)

MethodPathPurpose
GET/config/Returns runtime config (start coords, plugin lists, scanner type, login status, tile server, dangerous flag).
POST/config/loginCreates a logged-in session when { \"password\": KOJI_SECRET } matches.
GET/config/logoutClears current session and redirects to /.
GET/config/nominatim?query=...Nominatim search proxy (returns polygon/multipolygon results only).

Internal Instance Routes (/internal/routes)

MethodPathPurpose
GET/internal/routes/from_scannerList area/instance references from scanner/controller DB.
GET/internal/routes/from_kojiList 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.

MethodPathPurpose
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.

MethodPathPurpose
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

MethodPathPurpose
GET/internal/admin/{resource}/parentUnique 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)

MethodPathPurpose
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