REST API Reference¶
All notebook endpoints are under /v1/notebooks.
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.
Delete Notebook¶
Deletes the notebook directory and closes the session.
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¶
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.
DAG¶
Get DAG¶
Returns edges, roots, leaves, and topological order.
Environment¶
List Dependencies¶
Add Dependency¶
Remove Dependency¶
Get Environment State¶
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¶
Export¶
Export Notebook Bundle¶
Returns a zip bundle containing notebook.toml, cells, and environment files.
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¶
Runtime Config¶
Get Notebook Runtime Config¶
Returns deployment mode, available Python versions, and default paths.
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.