POST /api/save-to-file endpoint persists Studio changes to the local JSON data files on disk. It accepts a projectState object — the full in-memory representation of edited content — and the slug of the page being saved, then writes the updated data to the appropriate file under src/data/ (for example, src/data/pages/about.json for the About page).
The Studio editor calls this endpoint automatically when you save in the UI. You can also call it directly from scripts or custom tooling during local development.
Request
- Method:
POST - Path:
/api/save-to-file - Content-Type:
application/json
object
required
The full project state object produced by the Studio editor. Contains all pages, collections, and site-level data in their edited form.
string
required
The slug of the page or collection entry being saved — for example
"about" or "posts/write-the-readme-first". Used to determine which file on disk to write.Response
200 OK — The data was written to disk successfully.boolean
Always
true on a successful save..png?fit=max&auto=format&n=AyzhRn9-CO-nDNc4&q=85&s=63c78e2325701880237e6cbce1399c2a)
.png?fit=max&auto=format&n=AyzhRn9-CO-nDNc4&q=85&s=0db283df6e4d31745079d6d03fd029ed)