Your computers
14 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.
Register this computer (the desktop app or CLI, with its own key)#
/v1/devicesscope sandboxes:readA device is the kosa8 desktop app or CLI on one person's computer; it belongs to the member whose key registered it. Only that member queues actions to it or reads them (an admin sees a count per member, never the actions), and only the key it registered with polls, claims and reports for it. Actions are a typed allowlist, never a shell string: an unknown type or field is 400. Idempotent per member, machine_id and app: 201 the first time, then 200 with the same device_id (key, name, version and capabilities refreshed). Only an API key may register (a web session gets 403 device_key_required). Capabilities this API does not know are left out and listed in ignored_capabilities. At most 20 computers per member (409 too_many_devices).
JSON bodynamerequiredstringosrequired"darwin" | "windows" | "linux"archrequiredstringapprequired"desktop" | "cli"versionrequiredstringcapabilitiesrequiredarray of stringmachine_idstringcurl -s -X POST https://api.kosa8.com/v1/devices \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
My computers#
/v1/devicesscope sandboxes:readAn admin also gets team: [{member, total, online}], how many computers each member has (never their actions).
Responsescurl -s -X GET https://api.kosa8.com/v1/devices \ -H "Authorization: Bearer $KOSA8_API_KEY"
One of my computers#
/v1/devices/{id}scope sandboxes:readidrequiredpath · stringcurl -s -X GET https://api.kosa8.com/v1/devices/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"
Unlink one of my computers#
/v1/devices/{id}scope sandboxes:readIts waiting and running actions are cancelled. The key it used stays until revoked under API keys.
Parametersidrequiredpath · stringcurl -s -X DELETE https://api.kosa8.com/v1/devices/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"
Long-poll for this computer's next action (the device's own key)#
/v1/devices/{id}/actions/nextscope sandboxes:readMarks the computer online (seen < 60 s). Returns the oldest action queued to it, or pending for any of the member's computers of a type it can run, and marks it picked up; an action picked up and still queued after 30 s is sent again, so set status waiting_for_approval as soon as the approval sheet shows. approval_remembered says the person chose Always allow for this type here.
Parametersidrequiredpath · stringwaitquery · integercurl -s -X GET https://api.kosa8.com/v1/devices/$SBX/actions/next \ -H "Authorization: Bearer $KOSA8_API_KEY"
Take one action by its short code (kosa8 do) or id (kosa8://action/<id>)#
/v1/devices/{id}/actions/claimscope sandboxes:readOnce: a second claim by any computer is 409 already_claimed; an expired code is 410. Another member's action is 404. A code is itself the approval (approval: cli); a deep link is not.
Parametersidrequiredpath · stringcodestringaction_idstringcurl -s -X POST https://api.kosa8.com/v1/devices/$SBX/actions/claim \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Queue an action to one of my computers#
/v1/devices/{id}/actionsscope sandboxes:writeOnly the computer's own member; the computer must list the type in capabilities (409 not_capable). Types and their params: mcp.add {server_id: an MCP catalog id (GET /app/mcp-catalog.json), options: only the keys that entry's options declare (dir, read_only, name, allow_tools); never a secret, which the computer asks for}; mcp.remove {server_id: its name on the computer}; mcp.sync {} (the device then reports PUT …/inventory); agent.connect {client: claude-code | codex | gemini | qwen | opencode | copilot | vscode | cursor | windsurf | cline | amp | goose | kilo | droid | continue | zed | claude-desktop | jetbrains}; terminal.open {mode: "sandbox", sandbox_id} (a sandbox of this organization; needs sandboxes:write) or {mode: "local", cwd?}; repo.clone {repo: owner/name, ref?, dir?} (the person's own git credentials); cli.upgrade {}; app.open {page}. Paths are absolute (/…, ~/…, C:\…) with no .. and no control characters. The answer is the action (201) with its planned steps.
Parametersidrequiredpath · stringtyperequired"mcp.add" | "mcp.remove" | "mcp.sync" | "agent.connect" | "terminal.open" | "repo.clone" | "cli.upgrade" | "app.open"paramsobjectcurl -s -X POST https://api.kosa8.com/v1/devices/$SBX/actions \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Report an action's progress (the device that claimed it, with its own key)#
/v1/devices/{id}/actions/{aid}scope sandboxes:readsteps update by key (a new key needs a label and is added at the end); started_at and ended_at are stamped here. status moves queued → waiting_for_approval → running → done | failed | cancelled (409 invalid_transition otherwise); failed needs error. approval: once | always (remembered for this type on this computer) | denied (cancels it). On a cancelled or finished action the answer is 409 action_cancelled or action_finished: stop. Audited as device.action.run, done, fail or cancel when the status changes.
Parametersidrequiredpath · stringaidrequiredpath · stringstatus"waiting_for_approval" | "running" | "done" | "failed" | "cancelled"stepsarray of objectresultobjecterrorobjecterror.coderequiredstringerror.messagerequiredstringerror.fixstringapproval"once" | "always" | "denied"curl -s -X PATCH https://api.kosa8.com/v1/devices/$SBX/actions/$AID \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Report what is installed on this computer (the device's own key)#
/v1/devices/{id}/inventoryscope sandboxes:readidrequiredpath · stringmcparray of objectagentsarray of objectcurl -s -X PUT https://api.kosa8.com/v1/devices/$SBX/inventory \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Forget an Always allow on one of my computers#
/v1/devices/{id}/approvals/{type}scope sandboxes:readThe computer asks again the next time an action of that type arrives.
Parametersidrequiredpath · stringtyperequiredpath · stringcurl -s -X DELETE https://api.kosa8.com/v1/devices/$SBX/approvals/$TYPE \ -H "Authorization: Bearer $KOSA8_API_KEY"
Queue an action for any of my computers#
/v1/actionsscope sandboxes:writePending until the first of my computers that can run it picks it up, or until kosa8 do <short_code> claims it; expired after 10 minutes. At most 50 waiting (429). Types and their params: mcp.add {server_id: an MCP catalog id (GET /app/mcp-catalog.json), options: only the keys that entry's options declare (dir, read_only, name, allow_tools); never a secret, which the computer asks for}; mcp.remove {server_id: its name on the computer}; mcp.sync {} (the device then reports PUT …/inventory); agent.connect {client: claude-code | codex | gemini | qwen | opencode | copilot | vscode | cursor | windsurf | cline | amp | goose | kilo | droid | continue | zed | claude-desktop | jetbrains}; terminal.open {mode: "sandbox", sandbox_id} (a sandbox of this organization; needs sandboxes:write) or {mode: "local", cwd?}; repo.clone {repo: owner/name, ref?, dir?} (the person's own git credentials); cli.upgrade {}; app.open {page}. Paths are absolute (/…, ~/…, C:\…) with no .. and no control characters. The answer is the action (201) with its planned steps.
typerequired"mcp.add" | "mcp.remove" | "mcp.sync" | "agent.connect" | "terminal.open" | "repo.clone" | "cli.upgrade" | "app.open"paramsobjectcurl -s -X POST https://api.kosa8.com/v1/actions \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
My actions, newest first#
/v1/actionsscope sandboxes:readlimitquery · integerdevice_idquery · stringcurl -s -X GET https://api.kosa8.com/v1/actions \ -H "Authorization: Bearer $KOSA8_API_KEY"
One of my actions (poll about every second while it runs)#
/v1/actions/{aid}scope sandboxes:readaidrequiredpath · stringcurl -s -X GET https://api.kosa8.com/v1/actions/$AID \ -H "Authorization: Bearer $KOSA8_API_KEY"
Cancel one of my actions#
/v1/actions/{aid}/cancelscope sandboxes:readA running action's computer learns on its next report (409 action_cancelled).
Parametersaidrequiredpath · stringcurl -s -X POST https://api.kosa8.com/v1/actions/$AID/cancel \ -H "Authorization: Bearer $KOSA8_API_KEY"