Skip to content

API overview ​

The REST API serves the operator console, external management systems, and compatible clients. Agent and SDK communication is a separate session protocol; see Architecture and SDK Wire protocol.

Basics ​

ItemValue
Base path/api/v1/
TransportHTTP or HTTPS
AuthenticationJWT bearer token
Business scope headersX-Game-ID, X-Env
Control payloadProtobuf envelopes
Business payloadUTF-8 JSON

Most management operations require an authenticated user and a permission check. Risky function execution may also require an approval and is recorded in the audit stream.

Primary domains ​

DomainPurpose
Auth and profileLocal login, external identity providers, permission checks, user profile, and administrator management.
Functions and resourcesRegister, inspect, invoke, and manage functions; review resource semantics and page proposals.
Pages and consoleDraft, validate, publish, diff, and roll back operator pages and dynamic menus.
Approvals and auditReview risky operations and retain administrative evidence.
OperationsAgents, nodes, registry, monitoring, notifications, backups, certificates, rate limits, and platform operations.
AnalyticsMetric queries, behavior, retention, payment, and game-performance reporting.
Site settingsBranding, notification, security, outbound integration, and login-provider configuration.

Contract discipline ​

The effective route registration is the source of truth for endpoint existence. A domain should have one canonical page; compatibility pages must be marked as compatibility rather than extended with new semantics. When documentation and code disagree, update the documentation before adding another endpoint.

When a registered endpoint family does not yet have a standalone page, document its handler path in this overview and use the handler as the implementation reference.

Endpoint families without a standalone page ​

The route table in internal/handler/routes.go is the source of truth. The families below are registered but do not yet have their own API page; the route line is the implementation reference.

FamilyRegistered routesPurpose
Ops - provisionPOST/GET /api/v1/ops/provision, GET /api/v1/ops/provision/:runId, POST /api/v1/ops/provision/:runId/{resume,destroy}, PUT /api/v1/ops/provision/:runId/protection, DELETE /api/v1/ops/provision/:runId (routes.go:691-697)Provision-engine run lifecycle (terraform/tofu)
Ops - deploymentsPOST/GET /api/v1/ops/deployments, GET /api/v1/ops/deployments/:id, POST /api/v1/ops/deployments/:id/{start,rollback} (routes.go:703-707)Deployment engine
Ops - agent logsGET /api/v1/ops/agents/:agentId/logs/search (routes.go:629)Agent log tailing/search
Ops - agent metricsGET /api/v1/ops/agents/:agentId/metrics/history (routes.go:654)Agent metrics history
Ops - supervisorGET /api/v1/ops/agents/:agentId/supervisor, .../supervisor/events, .../supervisor/logs (routes.go:576-579)Managed-process supervision
Ops - alertsGET /api/v1/ops/alerts, POST /api/v1/ops/alerts/silence, POST /api/v1/ops/alerts/:id/handle (routes.go:592-595)Alert list / silence / handle
Ops - capture gatesGET/PUT /api/v1/ops/capture/gates, GET /api/v1/ops/capture/gates/versions, POST /api/v1/ops/capture/gates/{rollback,validate} (routes.go:659-664)CDC capture policy gates
Ops - cost controlPOST /api/v1/ops/cost/estimate, GET /api/v1/ops/cost/{summary,idle,budget}, PUT /api/v1/ops/cost/budget (routes.go:699-705)Cost estimation, node cost, idle reclaim, budget
Ops - runbooksPOST/GET /api/v1/ops/runbooks, GET/DELETE /api/v1/ops/runbooks/:id, POST /api/v1/ops/runbooks/:id/run, GET /api/v1/ops/runbook-runs, GET /api/v1/ops/runbook-runs/:runId (routes.go:634-641)Runbook automation (parameterized OPS-004/006 steps)
ApprovalsregisterApprovalRoutes (routes.go:232); list filters state/functionId/gameId/env/page/pageSize (internal/api/approval/dto.go:41-45)Two-person-rule approval
AuditGET/POST /api/v1/audit, GET /api/v1/audit/export, GET /api/v1/audit/chain/verify (routes.go:745-748)Audit chain query / export / integrity verify

Discovery examples ​

http
GET /healthz
GET /readyz
GET /api/v1
GET /api/v1/monitoring/healthz
GET /api/v1/monitoring/metrics
GET /api/v1/monitoring/status

Health, readiness, and version endpoints are useful smoke checks. Monitoring metrics and status require authentication.