Machine play API
Create or log in to an account, save an owned-card
loadout, join a public 2-, 4-, or 7-player seat, and observe only its authorized state.
Call matches with the account token to discover active hosted seats,
then resume with its game ID and player index after reconnecting.
The catalog never exposes seat tokens; resume returns the selected seat token
and a full recovery state. A browser-started hosted account seat can be resumed
through this API too. Create or log in before joining if a seat must be
recoverable: guest seats have no account catalog. Loadout changes apply to
future joins only.
Submit actions through the shared Java engine. This page and the specification are generated from the same route and action definitions.
Quick start
POST /api/machine/account/create
{"username":"MyBot","password":"choose-a-secret"}
POST /api/machine/account/loadout
{"accountToken":"ACCOUNT_TOKEN","loadout":[]}
POST /api/machine/join
{"accountToken":"ACCOUNT_TOKEN","playerLimit":4,"timed":false}
POST /api/machine/matches
{"accountToken":"ACCOUNT_TOKEN"}
POST /api/machine/resume
{"accountToken":"ACCOUNT_TOKEN","gameId":"GAME_ID","player":0}
Use each joined or resumed seat token for its own event stream, state recovery, and checked actions. The account token is only for profile and match-catalog operations. A new account owns no optional technology cards; its loadout can include a technology after that card is earned or traded.
Operations
POST /api/machine/account/createCreate a machine-play accountPOST /api/machine/account/loginLog in and receive an account tokenPOST /api/machine/account/profileRead loadout and owned cardsPOST /api/machine/account/loadoutSave a loadout using owned cardsPOST /api/machine/matchesList active hosted match seats for this accountPOST /api/machine/resumeRejoin one active hosted match seatPOST /api/machine/joinJoin a viewer-safe match seatPOST /api/machine/stateRead your current public state or a retained deltaPOST /api/machine/actionSubmit one checked, idempotent actionPOST /api/machine/auditAudit a finished match's private seeded journalGET /api/machine/openapi.jsonGet the generated OpenAPI descriptionGET /api/machine/docsRead the machine API documentation
Action types
add-aicountmovepieceId, q, rabilitypieceId, targetId, q, r, sourceQ, sourceRskipno argumentsforest-mixsourceId, targetIdcity-penaltypieceIdplace-wheatq, rbuykind, quantityplace-purchaseq, rremove-terrainpieceId, q, rpause-matchactionend-matchno arguments
Subscribe to GET /api/events with
Authorization: Bearer <seat token> for an initial full view
and later checked updates; keep one stream per seat and tag updates locally by
that stream's game ID and player index. No state polling is needed. Use
machine/state only for explicit recovery. Otherwise pass the token
in POST JSON. Supply the
displayed revision and stateChecksum for each action. Accepted
actions return the same per-piece checked update used by the web and app
clients. Join and explicit recovery send full snapshots. The
opening commitment root is public during play. Full private
disclosure is available only after the match finishes.
Copyright © 2026 Eco Farm Online S.R.O. All rights reserved.