REST API Reference¶
This page documents the notebook REST surface, mounted under /v1/notebooks. Strata Core also exposes a POST /v1/materialize endpoint for direct artifact materialization, see the Core Quickstart for that surface.
Session ID vs Notebook ID
Route parameters use the session ID (a UUID generated when the notebook is opened), not the persistent notebook_id from notebook.toml. The session ID is returned by the open and create endpoints.
Notebook Lifecycle¶
Create Notebook¶
{
"parent_path": "/path/to/directory",
"name": "My Notebook",
"python_version": "3.13",
"starter_cell": true
}
Returns notebook state with session_id.
Open Notebook¶
Returns notebook state with session_id and dag.
Import Jupyter Notebook¶
Form fields:
| Field | Type | Description |
|---|---|---|
file |
file (required) | The .ipynb upload. Hard cap of 50 MB. |
name |
string | Override the notebook name (defaults to the upload's filename stem). |
parent_path |
string | Override the storage location (must lie inside the configured storage root). |
Converts the upload through strata import and opens a session on
the result. Returns the same notebook state shape as POST
/v1/notebooks/create plus an import_report field with the
converter's per-cell findings (translated magics, captured deps,
warnings, full report markdown). See
Import from Jupyter for the magic
translation table and limitations.
Delete Notebook¶
Deletes the notebook directory and closes the session.
Discover Notebooks¶
Lists notebook directories under the configured storage root. Returns
{ "root", "notebooks": [{ "path", "name", "notebook_id", "updated_at" }] }
sorted newest-first. Used by the "Open existing" UI so users pick from a list
instead of typing a filesystem path. Personal mode only.
Delete Notebook By Path¶
Deletes a notebook directory by filesystem path. This is primarily a personal-mode management endpoint.
Rename Notebook¶
Sessions¶
List Sessions¶
Returns { "sessions": [{ "session_id", "name", "path", ... }] }.
Get Session¶
Returns full notebook state (same shape as open). Used for page refresh reconnection.
Cells¶
List Cells¶
Add Cell¶
language may be python, prompt, markdown, or sql. Defaults to python.
Update Cell Source¶
Returns updated cell, DAG, and all cells (with refreshed staleness).
Delete Cell¶
Reorder Cells¶
Execute Cell (REST)¶
Tip
For interactive use, prefer the WebSocket cell_execute message. The REST endpoint is for programmatic access.
List Loop Cell Iterations¶
Lists stored iteration artifacts for a @loop cell. The variable query
parameter defaults to the loop's carry variable if omitted. Non-loop cells
and loops with no completed iterations return an empty list, safe to poll
from the inspect panel.
Returns { "cell_id", "variable", "iterations": [{ "iteration", "artifact_uri",
"artifact_id", "version", "content_type", "byte_size", "row_count",
"created_at" }] }.
DAG¶
Get DAG¶
Returns edges, roots, leaves, and topological order.
Environment¶
List Dependencies¶
Add Dependency¶
Remove Dependency¶
Get Environment State¶
Sync Environment¶
Runs uv sync synchronously and invalidates any stale cell runtimes. Returns
the full environment payload plus lockfile_changed, operation_log
(command, duration, stdout/stderr), and the per-cell staleness map.
For long syncs prefer the background POST /environment/jobs path, this
endpoint blocks the request until the sync finishes.
Get Current Environment Job¶
Start Environment Job¶
Actions: add, remove, sync, import.
For import, send exactly one of requirements or environment_yaml.
Export Requirements¶
Import Requirements¶
Preview Requirements Import¶
Import environment.yaml¶
Preview environment.yaml Import¶
Workers¶
List Workers¶
Update Notebook Worker¶
Update Worker Catalog¶
Mounts¶
Update Notebook Mounts¶
Connections¶
List Notebook Connections¶
Returns:
Replace Notebook Connections¶
The list is canonical: sending an empty list deletes the entire [connections]
block. Literal auth values are blanked on disk during the write round-trip, but
kept in-memory until the session reloads.
Returns:
Enumerate Connection Schema¶
Enumerates the tables and columns visible through the named connection. Used by
the schema sidebar. Opens the connection on the read path and returns backend
errors directly as 4xx so auth / driver / connectivity failures are visible
to the UI.
Export¶
Export Notebook¶
One endpoint, three output formats:
fmt |
Returns |
|---|---|
zip (default) |
Reproducible bundle, notebook.toml, pyproject.toml, uv.lock, cells, provenance.json. |
markdown |
Single-file rendering for sharing / docs ingestion. Same engine as strata export. |
html |
Standalone HTML with embedded CSS + Pygments syntax highlighting. |
Markdown and HTML renderings additionally accept include_inactive_variants=true to stack all variants of every group. Prompt-cell responses are intentionally excluded from rendered formats (see Export).
AI¶
Get AI Status¶
List Provider Models¶
Update Notebook AI Model¶
Chat Completion¶
Streaming Chat¶
Server-Sent Events stream with delta, done, and error events.
Agent Run¶
Reset Agent Session¶
Clears the assistant's in-memory conversation / tool session for that notebook.
Runtime¶
Get Server Runtime Config¶
Returns deployment mode, available Python versions, and default paths for the server as a whole. Not notebook-scoped.
Update Notebook Default Timeout¶
timeout is seconds (0 < t ≤ 86400) or null to clear back to the system
default. Returns the new timeout and the refreshed cell list.
Update Notebook Default Env¶
Replaces the [env] block in notebook.toml. Sensitive values (keys matching
KEY/SECRET/TOKEN/PASSWORD/CREDENTIAL) are blanked on disk but kept
in-memory for the session so key-dependent cells keep working. Returns the
merged env, per-key sources, and refreshed cell list.
Update Secret Manager Config¶
{
"provider": "infisical",
"project_id": "your-project-id",
"environment": "dev",
"path": "/",
"base_url": null
}
Persists the [secret_manager] block to notebook.toml and immediately
refetches. An empty payload (all fields null) removes the block:
"disconnect from secret manager". Credentials are never part of this payload;
they must be exported in the server's shell environment.
Refresh Secret Manager¶
Re-fetches secrets from the configured manager and merges them into env.
Never returns 500 on fetch failure, the error surfaces in
env_fetch_error so the UI can display it next to the Refresh button.
Core API¶
Materialize¶
{
"inputs": ["file:///warehouse#db.events"],
"transform": {
"executor": "scan@v1",
"params": { "columns": ["id", "value"] }
},
"mode": "stream",
"name": "my_result"
}
Get Stream¶
Returns Arrow IPC stream.