{"openapi":"3.1.0","info":{"title":"Cardweave.ai API","version":"1.0.0","description":"REST API exposing the actions of the Cardweave.ai product. Authenticate with a Kavaro API key as a bearer token."},"servers":[{"url":"https://kavaro.ai"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"A Kavaro API key (user- or organization-scoped)."}}},"security":[{"ApiKeyAuth":[]}],"paths":{"/api/rest/actions/build_game":{"post":{"operationId":"build_game","summary":"Build a game","description":"Build a NEW card game conversationally: a sub-agent makes incremental edits to the rules (zones, setup, moves, triggers, end condition) and saves it once it passes automated simulation. Use this when the user wants a new game.","tags":["actions"],"security":[{"ApiKeyAuth":[]}],"x-required-permissions":["games:edit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"instructions":{"type":"string","minLength":1,"description":"What card game to build, in plain language — the rules, special cards, and how a player wins."},"players":{"description":"Target number of players","type":"integer","minimum":1,"maximum":10}},"required":["instructions"],"additionalProperties":false}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid API key"},"403":{"description":"The key may not invoke this action"},"404":{"description":"Unknown action"}}}},"/api/rest/actions/edit_game":{"post":{"operationId":"edit_game","summary":"Edit a game","description":"Conversationally CHANGE an existing card game: a sub-agent loads the saved rules and applies only the requested change, then saves a new version. Use this for tweaks (e.g. 'make 8s wild') instead of rebuilding from scratch.","tags":["actions"],"security":[{"ApiKeyAuth":[]}],"x-required-permissions":["games:edit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"gameId":{"type":"string","description":"The id of the game to change"},"instructions":{"type":"string","minLength":1,"description":"The change to make, in plain language"}},"required":["gameId","instructions"],"additionalProperties":false}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid API key"},"403":{"description":"The key may not invoke this action"},"404":{"description":"Unknown action"}}}},"/api/rest/actions/copy_game":{"post":{"operationId":"copy_game","summary":"Copy a game","description":"Copy a game into the player's own library as a new, editable game. Use this to start from a built-in classic (e.g. Hearts, Crazy Eights) or another game before changing it — the original is read-only and stays untouched. After copying, use edit_game on the new copy to make changes.","tags":["actions"],"security":[{"ApiKeyAuth":[]}],"x-required-permissions":["games:edit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sourceId":{"type":"string","description":"The id of the game to copy (a built-in catalog game or an existing game)"}},"required":["sourceId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid API key"},"403":{"description":"The key may not invoke this action"},"404":{"description":"Unknown action"}}}},"/api/rest/actions/set_visibility":{"post":{"operationId":"set_visibility","summary":"Change visibility","description":"Change a game's visibility: private (only you), org (your organization), or public (shared catalog).","tags":["actions"],"security":[{"ApiKeyAuth":[]}],"x-required-permissions":["games:edit"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"gameId":{"type":"string"},"visibility":{"type":"string","enum":["private","org","public"]}},"required":["gameId","visibility"],"additionalProperties":false}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid API key"},"403":{"description":"The key may not invoke this action"},"404":{"description":"Unknown action"}}}},"/api/rest/actions/delete_game":{"post":{"operationId":"delete_game","summary":"Delete a game","description":"Permanently delete a card game.","tags":["actions"],"security":[{"ApiKeyAuth":[]}],"x-required-permissions":["games:delete"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"gameId":{"type":"string"}},"required":["gameId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid API key"},"403":{"description":"The key may not invoke this action"},"404":{"description":"Unknown action"}}}}}}