Skip to main content
GridOS keeps your workbook in memory while the server is running. The endpoints on this page let you persist that state to disk, restore it, exchange workbooks as portable .gridos files, and selectively clear cell data. Use them to build save-on-exit workflows, backup scripts, or migration tooling.

POST /system/save

Persist the current in-memory workbook state to system_state.gridos in the server’s working directory. Call this endpoint whenever you want a recoverable snapshot — for example, before a large agent chain or at the end of a session.

Request

No request body required.

Response

string
"Success" when the state was written to disk.

Example

Response
The save file is written to system_state.gridos in the directory from which you started the GridOS server. Move or back up this file if you need off-server storage.

POST /system/load

Load the workbook state from the system_state.gridos save file and replace the current in-memory state. If no save file exists, the endpoint returns an error status (HTTP 200) rather than an HTTP error code.

Request

No request body required.

Response

string
"Success" when the state was loaded, or "Error" when the save file does not exist.
string
Present only when status is "Error". Value: "No save file found.".

Example

Response (success)
Response (no save file)
Loading replaces the entire in-memory workbook. Any unsaved changes made since the last POST /system/save are lost.

GET /system/export

Download the current workbook as a .gridos file. The response is a file attachment with a timestamped filename derived from the workbook name. The file format is JSON and can be reimported with POST /system/import.

Query Parameters

None.

Response

Returns an application/json file download. The Content-Disposition header specifies a filename in the form workbookname-YYYYMMDD-HHMMSS.gridos.

Example

Response headers
Response body (truncated)
Export timestamps use UTC. The filename replaces spaces in the workbook name with underscores and strips characters that are not alphanumeric, hyphens, or underscores.

POST /system/import

Replace the current workbook with the state contained in a .gridos file you previously exported. Send the parsed JSON content of the file as the request body.

Request

The request body must be the full state dictionary from a .gridos file — i.e. the JSON object you would get from GET /system/export. Set the Content-Type header to application/json.
object
required
The complete workbook state dictionary. At minimum it must be a valid JSON object. The exact schema matches the output of GET /system/export.

Response

string
"Success" when the workbook was imported and is now the active state.

Errors

Example

Response
Importing overwrites the entire current workbook immediately. There is no merge — the imported state fully replaces what is in memory. Save your current work first if you need it.

POST /system/clear

Clear all unlocked cells on a sheet. Locked cells are preserved exactly as they are. This is the standard way to reset user-entered data while keeping any protected structure or template content in place.

Query Parameters

string
The sheet to clear. Defaults to the currently active sheet when omitted.

Response

string
"Success" when the clear operation completed.
string
The name of the sheet that was cleared.

Example

Response
Clearing a sheet does not remove its charts. Use DELETE /system/charts/{chart_id} to remove individual charts.