Feed the integrations

Shark Tank Control API

OpenAPI 3.0 · raw JSON →

GET /api/health

Liveness probe

Returns module name and server time.

Responses

GET /api/health responses
StatusDescription
200Healthy — application/json HealthResponse

GET /api/tank

List joinable tanks

Stable catalog of ocean-named tanks with live player counts and top score. One earlier path name still reaches this same handler.

Responses

GET /api/tank responses
StatusDescription
200Tank list — application/json TankResponse

GET /api/leaderboard

Global leaderboard

Top scores across all tanks, persisted by the control plane.

Responses

GET /api/leaderboard responses
StatusDescription
200Top scores — application/json LeaderboardResponse

GET /api/profile

Read a player profile

Parameters

GET /api/profile parameters
NameInReqTypeDescription
idquerynostringPlayer id (default: local)

Responses

GET /api/profile responses
StatusDescription
200Profile — application/json ProfileResponse

POST /api/profile

Upsert a player profile

Unauthenticated: the identity is a `wg_player` cookie the first GET mints, so the cookie cannot be the throttle key. Writes are bucketed per edge connection and, separately, under a global ceiling across every public caller at once — an overwrite of an existing row costs the same Durable Object write as a new one, so both branches are metered. Bodies over 16 KiB are refused, and the ceiling is enforced on the bytes that actually arrive rather than on a declared `Content-Length`. When the spend gate is closed this route is refused with 503 along with the game, because it is one of the writes the spend limit exists to stop.

Parameters

POST /api/profile parameters
NameInReqTypeDescription
idquerynostringPlayer id (default: local)

Request body (required)

application/jsonProfile

Responses

POST /api/profile responses
StatusDescription
200Saved profile — application/json ProfileResponse
413Payload too large
429Rate limited, per connection or across all public callers
503Spend gate closed

POST /api/audit

Record a public gameplay event

The only unauthenticated write into the 90-day service action log, and the reason that log carries two limits the trusted server-side callers do not. Accepts exactly two event types: `play` (which requires a `room` from the fixed tank list) and `customize` (whose `detail` must match `skin <id>` or is replaced with a fixed phrase). Bodies over 16 KiB are refused, and the ceiling is enforced on the bytes that actually arrive rather than on a declared `Content-Length`, so a chunked body cannot slip past it. Writes are bucketed per edge connection and, separately, under a global ceiling across every public caller at once; publicly written rows are then trimmed to their own floor before the whole-log trim runs, so a flood can only evict other public rows and never server-recorded evidence. The display name attached to the row is resolved on the server behind that rate limit, never taken from the request.

Responses

POST /api/audit responses
StatusDescription
200Event recorded — application/json object
400Unsupported public event type, or a play event without a valid tank
413Payload too large
429Rate limited, per connection or across all public callers
503Spend gate closed

POST /api/security-report

Report a security issue

Same-origin public white-hat intake. One request creates a linked report, a retained audit event, and an append-only SHA-256 control-history receipt, and raises the report to operations. It does not change service state: the game stays online, no incident is opened, and no tank is disconnected. Whether a report warrants downtime is a separate authenticated operator decision made at /admin/security-report. Accepted reports are throttled globally to one per minute. Returned metadata is limited to environment, deployment, colo, and country; it contains no secrets or IP data. A report is not confirmation of compromise.

Parameters

POST /api/security-report parameters
NameInReqTypeDescription
X-WG-Security-Reportheaderyesenum: white-hat

Responses

POST /api/security-report responses
StatusDescription
200Security report receipt — application/json object
403Same-origin report required
429A security report was accepted moments ago
502Report could not be persisted

GET /room/{id}/ws

Realtime play (WebSocket upgrade)

Upgrades the connection (HTTP 101) into the tank's realtime Room. **Client → server** messages: `{t:'hello',name,skin,debugLanguage}`, `{t:'debug',language}` (selected TypeScript/PHP capture tag), `{t:'input',action}` (action = setHeading/setBoost/rocket/respawn), `{t:'ping',ts}`. **Server → client**: `welcome`, `state` (per-tick snapshot), `leaderboard`, `died`, `pong`.

Parameters

GET /room/{id}/ws parameters
NameInReqTypeDescription
idpathyesstringTank id (e.g. room-1)
roomNamequerynostringDisplay name for the tank

Responses

GET /room/{id}/ws responses
StatusDescription
101Switching Protocols — WebSocket established
426Upgrade Required — request was not a WebSocket upgrade

GET /docs/

API documentation (this page)

Renders this OpenAPI document as HTML. Raw document at /docs/openapi.json.

Responses

GET /docs/ responses
StatusDescription
200HTML documentation — text/html string

GET /docs/openapi.json

OpenAPI document

This document. Also served at `/openapi.json`, which is the path the conformance register's evidence index links to.

Responses

GET /docs/openapi.json responses
StatusDescription
200OpenAPI 3.0 document — application/json object

GET /trust/

Trust and operations overview

The entry point to the published evidence: availability, incidents, metered spend, conformance readiness, the last deployment and the receipt chain verdict. Every figure is computed from the same source the owning page uses and links to it; none is stored a second time.

Responses

GET /trust/ responses
StatusDescription
200Trust overview — text/html string

GET /roadmap/

Change record (moved)

Permanently redirects to `/status/#delivery`, where the change record now lives. `/roadmap.json` did not move and is unchanged.

Responses

GET /roadmap/ responses
StatusDescription
301Moved to /status/#delivery

GET /roadmap.json

Mission and feature-to-deployment map (JSON)

Responses

GET /roadmap.json responses
StatusDescription
200Availability, delivery velocity, elapsed time, deployment batches, and feature updates — application/json object

GET /status/

Operations dashboard

Operations. Server and tank availability, live tank occupancy with the computer-controlled agent count beside it, state copies and restore drills, the full incident record at `#incidents`, the append-only control receipt chain at `#control-history`, and the change record at `#delivery`. Spend is at `/spend/`; operator controls are behind authentication at `/admin/`.

Responses

GET /status/ responses
StatusDescription
200HTML dashboard — text/html string

GET /status.json

Status (JSON)

Responses

GET /status.json responses
StatusDescription
200Independent server and tank availability, scheduled downtime, rooms, incidents, and control receipts — application/json StatusResponse

GET /incidents/

Incident record (moved)

Permanently redirects to `/status/#incidents`. `/incidents.json` did not move and is unchanged.

Responses

GET /incidents/ responses
StatusDescription
301Moved to /status/#incidents

GET /incidents.json

Public incident and control history (JSON)

Responses

GET /incidents.json responses
StatusDescription
200Availability summary, incident records, control entries, and SHA-256 chain head — application/json object

GET /spend/

Cost and capacity meters

Links normal game and operations actions to measured Workers, Durable Objects, D1 and R2 usage, against each free-tier allowance and against the hard spend limit that closes the game rather than billing. Previously served at `/inquiry/`, which still redirects here.

Responses

GET /spend/ responses
StatusDescription
200Cost and capacity meters — text/html string

GET /spend.json

Cost and capacity meters (JSON)

Also served at `/inquiry.json`, the pre-rename name, which is unchanged.

Responses

GET /spend.json responses
StatusDescription
200Proof-of-concept statement and reset-window billing summary — application/json object

GET /inquiry/

Cost and capacity meters (moved)

Permanently redirects to `/spend/`.

Responses

GET /inquiry/ responses
StatusDescription
301Moved to /spend/

GET /logs/

Public reason-coded logs

Searchable, filterable service evidence with 90-day retention plus the 40 newest reason-coded captures per ocean tank and sanitized TXT downloads.

Responses

GET /logs/ responses
StatusDescription
200Public Shark Tank evidence — text/html string

GET /logs.json

Public service and tank logs (JSON)

Every row includes a letter-plus-three-digit reason code. Tank records use the same timestamp, reasonCode, tick, action, language, name, and details fields as the live inspector and TXT export.

Responses

GET /logs.json responses
StatusDescription
200Public service and tank event stream — application/json object

GET /logs/game/{id}.txt

Download a sanitized Shark Tank log

Plain UTF-8 text with timestamp,reason_code,tick,action,language,name,details comma-separated fields and newline-separated records. Internal player ids are omitted.

Parameters

GET /logs/game/{id}.txt parameters
NameInReqTypeDescription
idpathyesstring

Responses

GET /logs/game/{id}.txt responses
StatusDescription
200Downloadable TXT log — text/plain string
404Unknown tank

GET /audit/

ISO/IEC 27001 and ISO/IEC 42001 conformance register

Public, unauthenticated readiness register: every clause of ISO/IEC 27001:2022 and ISO/IEC 42001:2023, all 93 Annex A controls, all 38 AI controls, the fourteen documented change-management processes, the Stage 1 documented-information list, and an index of every route that serves as evidence. Each row carries a status, the justification behind it, and links to the live routes that prove it. This is a readiness statement, not a certificate.

Responses

GET /audit/ responses
StatusDescription
200Conformance register — text/html string

GET /audit/manifest.json

Conformance register (JSON)

The same register as machine-readable data, for independent scoring or import into a compliance tool.

Responses

GET /audit/manifest.json responses
StatusDescription
200Standards, status meanings, readiness summary, change processes, mandatory documents, control registers, and the evidence index — application/json object

GET /policies/

Governance policy index

The index of the written record ISO/IEC 27001:2022 and ISO/IEC 42001:2023 ask for, published as pages rather than filed. Each document is its own route at `/policies/{document}/`, searchable from here, and every section within a document has its own anchor.

Responses

GET /policies/ responses
StatusDescription
200Policy index — text/html string

GET /policies/{document}/

One governance document

A single document — context and scope, the information security policy, roles and authorities, the risk assessment and treatment processes, the Statement of Applicability cover, the risk treatment plan, the security and AI objectives, the AI policy with its impact assessment, the AI system life cycle, and the rest. Each names the clauses it is the record for, and the conformance register links to it directly. The document identifier is the `id` field in `/policies.json`.

Parameters

GET /policies/{document}/ parameters
NameInReqTypeDescription
documentpathyesstringDocument identifier, e.g. `risk-assessment`

Responses

GET /policies/{document}/ responses
StatusDescription
200Governance document — text/html string
404No such document — text/html string

GET /policies.json

Governance policy set (JSON)

The same documents as machine-readable data: reference, identifier, the route it is published at, title, purpose, the clauses each satisfies, its sections with their anchor ids, and what triggers its review.

Responses

GET /policies.json responses
StatusDescription
200Governance documents with their clause coverage and review triggers — application/json object

GET /admin/

Operations control panel

Protected HTML dashboard for action records, measured billing counters, billing reset, and maintenance mode. Formerly served at /audit/, which is now the public conformance register.

Responses

GET /admin/ responses
StatusDescription
200Control panel — text/html string
401Operations authentication required

GET /admin/log.json

Action log (JSON array)

90-day user and service action record. Also served at the pre-move path /audit.json.

Parameters

GET /admin/log.json parameters
NameInReqTypeDescription
limitquerynointeger

Responses

GET /admin/log.json responses
StatusDescription
200Audit events — application/json object
401Operations authentication required

GET /admin/log.jsonl

Action log (newline-delimited JSON)

Also served at the pre-move path /audit.jsonl.

Responses

GET /admin/log.jsonl responses
StatusDescription
200Audit event stream — application/x-ndjson string
401Operations authentication required

GET /admin/game/{id}.jsonl

Authenticated replayable room action log

Seed plus the ordered action stream for one tank — the ISO/IEC 42001 A.6.2.8 event record. Also served at /audit/game/{id}.jsonl.

Parameters

GET /admin/game/{id}.jsonl parameters
NameInReqTypeDescription
idpathyesstring

Responses

GET /admin/game/{id}.jsonl responses
StatusDescription
200Room actions with internal replay identifiers — application/x-ndjson string
401Operations authentication required

GET /admin/replay/{id}

Reconstruct a room at a retained tick

Deterministic reconstruction of authoritative state, including every autonomous agent, at a chosen tick. Also served at /audit/replay/{id}.

Parameters

GET /admin/replay/{id} parameters
NameInReqTypeDescription
idpathyesstring
tickquerynointeger

Responses

GET /admin/replay/{id} responses
StatusDescription
200Reconstructed authoritative state — application/json object
401Operations authentication required
410Complete replay history expired

GET /admin/status.json

Private operational status and billing data

The unredacted operational record, including the running version identifier and instance residency. Also served at /audit/status.json.

Responses

GET /admin/status.json responses
StatusDescription
200Full status, audit counters, and billing window — application/json object
401Operations authentication required

POST /admin/maintenance

Enable or disable maintenance mode

Same-origin Admin action. Enabling creates a separate operator-maintenance incident, closes active WebSockets, and returns the controlled 503 page for the game shell, game assets, and tank traffic while Roadmap, API, Docs, Status, Incidents, Inquiry, Logs, the conformance register, and Admin remain online. Disabling records the end of service impact but leaves independent security reports active until separately resolved. Every transition is persisted to the action log and the control-history receipt chain.

Parameters

POST /admin/maintenance parameters
NameInReqTypeDescription
X-WG-Ops-Actionheaderyesenum: maintenance

Request body (required)

application/jsonobject

Responses

POST /admin/maintenance responses
StatusDescription
200Maintenance state — application/json object
401Operations authentication required

POST /admin/billing-reset

Reset the billing measurement window

Resets measured billing baselines without resetting service uptime or status history.

Parameters

POST /admin/billing-reset parameters
NameInReqTypeDescription
X-WG-Ops-Actionheaderyesenum: billing-reset

Responses

POST /admin/billing-reset responses
StatusDescription
200Fresh billing window — application/json object
401Operations authentication required

POST /admin/security-resolve

Resolve owner-confirmed security exercises

Resolves open white-hat reports as owner-confirmed dry runs without changing the separate maintenance gate. Appends one immutable resolution receipt per report.

Parameters

POST /admin/security-resolve parameters
NameInReqTypeDescription
X-WG-Ops-Actionheaderyesenum: security-resolve

Request body (required)

application/jsonobject

Responses

POST /admin/security-resolve responses
StatusDescription
200Owner-confirmed resolution receipts — application/json object
400Owner confirmation and dry-run flag required
401Operations authentication required

POST /admin/security-report

File a security report and take the game down

Same-origin Admin action. Records the same report, audit event, and control-history receipt as the public intake, and additionally opens an active security incident, enables game maintenance, and disconnects active tanks pending operator review. Restoring game traffic records the end of service impact but does not resolve or close the security report; that is /admin/security-resolve. At most one security-report lockdown is open at a time — a repeat call while one is open returns the existing incident and creates no second incident or receipt. Roadmap, Status, Incidents, Inquiry, Logs, Docs, API, the conformance register, and authenticated Admin remain available throughout.

Parameters

POST /admin/security-report parameters
NameInReqTypeDescription
X-WG-Ops-Actionheaderyesenum: security-report

Responses

POST /admin/security-report responses
StatusDescription
200Linked lockdown and report receipt — application/json object
401Operations authentication required
403Same-origin operation required
502Report and lockdown could not be persisted

POST /admin/test-alert

Send an authenticated test alert

Accepts exactly one ASCII letter followed by three digits, normalizes the letter uppercase, and records the acknowledgement in the action log.

Parameters

POST /admin/test-alert parameters
NameInReqTypeDescription
X-WG-Ops-Actionheaderyesenum: test-alert

Request body (required)

application/jsonobject

Responses

POST /admin/test-alert responses
StatusDescription
200Test alert receipt — application/json object
400Code does not match letter-digit-digit-digit
401Operations authentication required

Schemas

HealthResponse

HealthResponse schema fields and types
FieldType
okboolean
modulestring
timestring (date-time)

TankRoom

TankRoom schema fields and types
FieldType
idstring
namestring
playersinteger
botsinteger
capacityinteger
topScoreinteger
topNamestring

TankResponse

TankResponse schema fields and types
FieldType
okboolean
roomsarray of TankRoom

ScoreEntry

ScoreEntry schema fields and types
FieldType
idstring
namestring
skinstring
scoreinteger
aliveboolean

LeaderboardResponse

LeaderboardResponse schema fields and types
FieldType
okboolean
entriesarray of ScoreEntry

Profile

Profile schema fields and types
FieldType
namestring
skinstring
bestinteger
settingsobject

ProfileResponse

ProfileResponse schema fields and types
FieldType
okboolean
profileProfile

AuditEvent

AuditEvent schema fields and types
FieldType
tsinteger
typeenum: room-boot, join, leave, death, play, customize, skin, settings, nav, quit, maintenance-on, maintenance-off, billing-reset, billing-hard-stop, security-report, security-resolved, test-alert
roomstring
subjectstring
detailstring

ControlHistoryEntry

ControlHistoryEntry schema fields and types
FieldType
sequenceinteger
tsinteger
codestring
actorstring
titlestring
summarystring
referencestring
detailstring
previousHashstring
hashstring

Usage

Usage schema fields and types
FieldType
startedAtinteger
uptimeMsinteger
presenceReportsinteger
durableObjectsobject

Availability

Availability schema fields and types
FieldType
windowHoursinteger
uptimeMsinteger
downtimeMsinteger
scheduledDowntimeMsinteger
unscheduledDowntimeMsinteger
availabilityPercentnumber
scheduledDowntimePercentnumber
unscheduledDowntimePercentnumber
calculatedAtstring (date-time)

StatusResponse

StatusResponse schema fields and types
FieldType
okboolean
maintenanceobject
usageUsage
historyarray of ControlHistoryEntry
historyIntegrityobject
roomsarray of TankRoom
globalarray of ScoreEntry
portalAvailabilityAvailability
tankAvailabilityAvailability

ErrorResponse

ErrorResponse schema fields and types
FieldType
okboolean
errorstring