Skip to main content

API Endpoints

The Race Platform API is a Hono app that runs on Node locally (port 6161) and on Cloudflare Workers in production.

All endpoints (except /health and /auth/*) require either:

Either credential carries the caller's accountId, which scopes every subsequent query.

There are 35 route modules in apps/api/src/routes/. The tables below group them by concern.

Auth + system

MethodPathPurpose
GET/healthLiveness check (no auth)
POST/auth/loginEmail/password login → JWT
POST/auth/registerRegister a new account / user
GET POST/auth/meCurrent user profile

Management entities

MethodPathPurpose
GET POST/championshipsList / create
GET PATCH DELETE/championships/:idGet / update / delete
GET POST/eventsList / create
GET PATCH DELETE/events/:id
GET POST/sessionsList (filter ?eventId=) / create
GET PATCH DELETE/sessions/:id
GET POST/cars
GET PATCH DELETE/cars/:id
GET POST/drivers
GET PATCH DELETE/drivers/:id
GET POST/tracks
GET PATCH DELETE/tracks/:id
GET POST/lap-markersList / create
PATCH DELETE/lap-markers/:id

Event-scoped entities

MethodPathPurpose
GET POST/run-sheetsList (filter ?sessionId=&carId=) / create
GET PATCH DELETE/run-sheets/:id
GET POST/lapsList (filter ?runSheetId= or ?sessionId=) / create
GET PATCH DELETE/laps/:id
GET POST/setups
GET PATCH DELETE/setups/:id
GET POST/tyre-sets
GET PATCH DELETE/tyre-sets/:id
GET POST/tyres
PATCH DELETE/tyres/:id
GET POST/tyre-wears
PATCH DELETE/tyre-wears/:id
GET POST/weather
PATCH DELETE/weather/:id
GET POST/board-cardsList (filter ?eventId=&column=) / create
GET PATCH DELETE/board-cards/:id
GET POST/issuesList / create issues
GET PATCH DELETE/issues/:id
POST/issues/:id/acknowledgeMark acknowledged
POST/issues/:id/resolveMark resolved

Per-event / per-session data

MethodPathPurpose
GET PATCH/event-dataPer-event constants
GET PATCH/session-dataPer-session constants
GET PATCH/account-optionsAccount-wide options

Customisation

MethodPathPurpose
GET POST/definitionsList (filter ?entityType=) / create
GET PATCH DELETE/definitions/:id
POST/definitions/:id/validate{ valid, errors[] }
GET POST/custom-views
GET PATCH DELETE/custom-views/:id
GET POST/custom-columns
GET PATCH DELETE/custom-columns/:id
GET POST/change-formattersList (filter ?entityType=) / create
GET PATCH DELETE/change-formatters/:id
GET POST/tyre-specifications
GET PATCH DELETE/tyre-specifications/:id

Workflow / operations

MethodPathPurpose
GET POST/issue-workflowsIssue state-machine definitions
GET PATCH DELETE/issue-workflows/:id
GET POST/data-analysis-profilesKPI profiles
GET PATCH DELETE/data-analysis-profiles/:id
POST/data-analysis-profiles/:id/evaluateEvaluate KPIs against a sample buffer
POST/run-plans/calculateHeadless run-plan calculator (same engine as the UI)

Permissions / API keys / webhooks

MethodPathPurpose
GET POST/permission-profilesPermission rule profiles
GET PATCH DELETE/permission-profiles/:id
GET/membershipsList memberships in the account
POST/memberships/:id/permission-profileAssign a profile to a membership
GET POST/api-keysAccount-scoped API keys (returns the secret only on create)
GET PATCH DELETE/api-keys/:id
GET POST/webhooksHMAC-signed webhook subscriptions
GET PATCH DELETE/webhooks/:id

Plugins

MethodPathPurpose
GET/pluginsList installed plugins
POST/plugins/uploadUpload manifest + base64 bundle
POST/plugins/:id/invoke/math{ fnName, args, ctx? }{ result }
POST/plugins/:id/invoke/kpi{ lapId, lap }{ results[] }
POST/plugins/:id/runLegacy combined-runner (retained for back-compat)
DELETE/plugins/:idUninstall

Import

MethodPathPurpose
GET POST/import-profilesReusable JSON-import scope trees
GET PATCH DELETE/import-profiles/:id
POST/importApply a JSON payload using a profile

Attachments

MethodPathPurpose
GET/attachments?entityType=&entityId=List for an entity
POST/attachments/uploadJSON-encoded base64 upload
GET/attachments/:idGet row + presigned download URL
GET/attachments/:id/downloadStream the binary
DELETE/attachments/:idDelete row + object

Response shape

All list endpoints return { items: [...] }. Single-resource endpoints return the bare object. Don't change this shape without coordinating with the Flutter client — there's a hard type-cast on the receiving side.

Errors follow:

{ "error": "human-readable message", "code": "OPTIONAL_CODE" }

Where to read the source

RouteFile
Each /xapps/api/src/routes/<x>.ts
Auth middlewareapps/api/src/middleware/auth.ts
Permission middlewareapps/api/src/middleware/permissions.ts
Schemaapps/api/src/db/schema.ts

What's coming

  • OpenAPI / Swagger spec — the routes today are Hono-typed but not exported as OpenAPI. Hono's @hono/swagger-ui package is on the queue.
  • /plugins/:id/source route for the in-browser flutter_js adapter
  • /plugins/:id/math/functions route to populate the Plugin Runner's function dropdown