Developers

What changed at each API version

Every change to the device’s contract moves its API version by one. Firmware 0.4 is the first to report one, so the numbering starts at 1 and the firmware before it is simply “before API versions”. Each section below says what a version added, whether it broke anything, and what to change in an app written for the version before it. The device holds no changelog; this page is the one place a migration note can be corrected after firmware has shipped.

How the numbers work A device answers GET /version with two numbers. api goes up by one on every change to the contract, additive or not. supports is the version of the most recent change that removed or altered something an older app might rely on; everything from there up to api was only added. An app declares the version it was written for in its app.json. If that is below supports, the admin page marks the app behind and links here; if it is above api, it says to update the firmware. Nothing is refused either way.

Before API versions → 1 apps, folders and per-folder permissions · firmware 0.4

Breaking

What changed

  • An app is now a folder on the card with an index.html and an app.json beside it. The manifest names the API version the app needs and, for paths inside its folder, whether everyone or only the owner may read, browse, upload and delete. Anything not mentioned defaults to read for everyone and everything else for the owner.
  • The four device-wide guest switches are gone, and so is GET/POST /auth/permissions. What a visitor may do is decided per folder by the app that lives there, as narrowed by the owner’s .app-overrides.json.
  • Guests can no longer write at the top level of the card unless a root app.json says so. A single .html file at the top level is served read-only; the admin page offers to give it its own folder.
  • Four files are the owner’s to write whatever any manifest says: app.json, .app-overrides.json and index.html in an app folder, and /.settings.json. Deleting an app folder outright is the owner’s too.
  • GPIO is closed to guests until the owner allows it from the admin page (an app asks with "gpio": true in its manifest; the grant lands in .app-overrides.json).
  • read can be restricted: a folder with "read": "owner" answers 401 to guests, for pages and data alike.
  • The homepage is a folder. GET /home returns {"folder", "exists"}, POST /home takes {"folder"}, and / redirects to /<folder>/ rather than serving the file in place (the top level is still served in place). The choice lives in /.settings.json on the card.
  • A directory URL serves its index.html; /whiteboard redirects to /whiteboard/ so relative URLs resolve inside the folder.
  • Some top-level folder names are reserved because they are routes: files, pin, auth, apps, admin, home, wifi, status, storage, benchmark, diagnostics, reboot, websocket, fs-info, device-name, version.
  • New: GET /version, GET /apps (every app’s resolved rules, public) and POST /files/rename (owner).

What to change in an app

  • Put it in a folder as index.html and add an app.json: {"api": 1, "title": "…", "paths": {"/": {"upload": "everyone"}}}, naming only the verbs it needs. The apps page’s examples are the reference.
  • Put pocket.js (from the author’s guide) beside index.html and use Pocket.readJson / Pocket.write / Pocket.list / Pocket.pin instead of raw fetch calls; it sends the header that keeps a 401 out of the browser’s password box and turns it into a message.
  • Keep its data beside index.html and address it relatively: fetch('board.json'), not fetch('/board.json'). Upload with POST /files?path=<its folder>; read the folder from location.pathname rather than hard-coding its name, so the folder can be renamed.
  • Stop reading /auth/permissions. If the app wants to hide controls a guest can’t use, read its own entry in GET /apps.
  • On a 401, tell the person in words what needs the owner (“Deleting needs the owner’s password”); never retry silently or show a raw status code.
  • If it uses the pins, add "gpio": true to the manifest and explain a 401 as “the owner has to allow pin control from the app’s folder on the admin page”.
  • If it read GET /home for a file path, read folder instead.

Copy a migration prompt

Pick the version your app was written for (0 means the firmware before versions existed) and the version you want, and this assembles the sections in between into a prompt for an AI assistant. Paste it, then paste your app’s index.html where it says to.