Notebooks
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
GET | |
POST | |
POST | |
GET | |
POST | |
POST | |
GET | |
POST | |
GET | |
POST | |
GET | |
GET | |
POST | |
POST | |
POST | |
POST | |
GET | |
POST | |
POST |
Create notebooks kernel start
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Path parameters
- short_idstring
Request parameters
- titlestring | null
- content
- text_contentstring | null
- versioninteger
- deletedboolean
- variablesarray
- _create_in_folderstring
Example request
POST /api /projects /:project_id /notebooks /:short_id /kernel /startExample response
Status 200 No response body
Retrieve notebooks kernel status
Live-checked kernel runtime state for this notebook, its compute configuration, and the catalog of dataframes/tables a cell can currently reference (with column schemas).
Required API key scopes
notebook:readPath parameters
- short_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /kernel /statusExample response
Status 200
Create notebooks kernel stop
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Path parameters
- short_idstring
Request parameters
- titlestring | null
- content
- text_contentstring | null
- versioninteger
- deletedboolean
- variablesarray
- _create_in_folderstring
Example request
POST /api /projects /:project_id /notebooks /:short_id /kernel /stopExample response
Status 200 No response body
Create notebooks runs
Run every SQL and Python cell of a markdown notebook, in document order, stopping at the first cell that does not finish. Returns as soon as the run starts; poll the run status endpoint until the status is terminal. Flag-gated (revamped-py-notebooks).
Required API key scopes
notebook:writequery:readPath parameters
- short_idstring
Request parameters
- include_prepared_insightsbooleanDefault:
false - variablesarray
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /runsExample response
Status 200
Retrieve notebooks runs
Read a whole-notebook run: its state, which cell it is on, and one line per planned cell. Carries no result rows — fetch a cell's result from the cell run result endpoint. Flag-gated (revamped-py-notebooks).
Required API key scopes
notebook:readquery:readPath parameters
- run_idstring
- short_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /runs /:run_idExample response
Status 200
Create notebooks runs interrupt
Stop a whole-notebook run and the cell it is on. Idempotent: stopping a run that already finished returns its outcome unchanged. Flag-gated (revamped-py-notebooks).
Required API key scopes
notebook:writePath parameters
- run_idstring
- short_idstring
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /runs /:run_id /interruptExample response
Status 200
Create notebooks sql v2 run
Dispatch an asynchronous run of a notebook SQL or Python cell. Returns a run_id immediately; poll the run result endpoint until the status is terminal. One run at a time per notebook. Python notebooks enable all run types. Generated widgets enable HogQL runs without a connection or kernel.
Required API key scopes
notebook:writequery:readPath parameters
- short_idstring
Request parameters
- reuse_resultsbooleanDefault:
false - node_idstring
- node_typeDefault:
hogql - codestring
- output_namestringDefault:
- refsobject
- variablesarray
- connection_idstring | null
- send_raw_querybooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /sql_v2 /runExample response
Status 200
Status 409 The notebook already has a cell running. Wait for it to finish, then run this one. A conflict with the notebook's state rather than a rate, so it is not worth retrying on a timer.
Status 429 The project has as many notebook cells in flight as it may. Unlike the 409, retrying shortly is the right response.
Retrieve notebooks sql v2 runs
Read a run's durable state: its status, and — once done or interrupted — the result envelope (columns, first rows, stdout/stderr, media, error). Poll until terminal. Requires notebook and query read access, including after a notebook feature flag is disabled.
Required API key scopes
notebook:readquery:readPath parameters
- run_idstring
- short_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /sql_v2 /runs /:run_idExample response
Status 200
Create notebooks sql v2 runs interrupt
Stop a running cell. Idempotent: interrupting an already-finished run returns its outcome unchanged. Flag-gated (revamped-py-notebooks).
Required API key scopes
notebook:writePath parameters
- run_idstring
- short_idstring
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /sql_v2 /runs /:run_id /interruptExample response
Status 200
Status 202
Retrieve notebooks sql v2 state
The full notebook view for agents: title, document source (markdown, or raw content for legacy rich-text notebooks), the notebook's declared variables, every cell with its dependency edges and derived run status (including staleness), and the kernel's runtime state and compute config. Flag-gated (revamped-py-notebooks).
Required API key scopes
notebook:readquery:readPath parameters
- short_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /sql_v2 /stateExample response
Status 200
Create notebooks widget snapshot
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writequery:readPath parameters
- short_idstring
Request parameters
- node_idstring
- version_idstring
- notebook_run_idstring
- previous_snapshot_idstring
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /widget_snapshotsExample response
Status 201
Status 400
Status 409
Retrieve notebooks widget snapshot
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:readquery:readPath parameters
- short_idstring
- snapshot_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /widget_snapshots /:snapshot_idExample response
Status 200
Retrieve notebooks widget snapshot
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:readquery:readPath parameters
- frame_namestring
- short_idstring
- snapshot_idstring
Query parameters
- limitintegerDefault:
100 - offsetintegerDefault:
0 - run_idstring
- version_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /widget_snapshots /:snapshot_id /frames /:frame_nameExample response
Status 200
Create notebooks widget snapshot
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writequery:readdashboard:writePath parameters
- short_idstring
Request parameters
- node_idstring
- version_idstring
- notebook_run_idstring
- previous_snapshot_idstring
- dashboard_idinteger
- tile_idinteger
- namestringDefault:
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /widget_snapshots /publishExample response
Status 201
Status 400
Status 409
Create notebooks widget
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- node_idstring
- short_idstring
Request parameters
- widget_idstring
- version_idstring | null
- input_bindingsobject
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /widgets /:node_id /attachExample response
Status 200
Status 400
Status 404
Status 409
Create notebooks widget
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- node_idstring
- short_idstring
Request parameters
- generation_idstring
Example request
POST /api /projects /:project_id /notebooks /:short_id /widgets /:node_id /cancelExample response
Status 204 No response body
Status 400
Status 404
Create notebooks widget
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- node_idstring
- short_idstring
Request parameters
- version_idstring | null
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /widgets /:node_id /forkExample response
Status 201
Status 400
Status 404
Status 409
Status 429
Retrieve notebooks widget
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:readquery:readPath parameters
- frame_namestring
- node_idstring
- short_idstring
Query parameters
- limitinteger
- offsetinteger
- run_idstring
- version_idstring
Response
Example request
GET /api /projects /:project_id /notebooks /:short_id /widgets /:node_id /frames /:frame_nameExample response
Status 200
Status 403
Status 404
Status 409
Status 429
Create notebooks widget
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writequery:readPath parameters
- node_idstring
- short_idstring
Request parameters
- promptstring
- generation_idstring
- modelDefault:
claude-sonnet-5 - generation_operationDefault:
regenerate - expected_current_version_idstring
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /widgets /:node_id /generateExample response
Status 202
Status 400
Status 403
Status 404
Status 409
Status 429
Create notebooks widget
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- node_idstring
- short_idstring
Request parameters
- version_idstring | null
Response
Example request
POST /api /projects /:project_id /notebooks /:short_id /widgets /:node_id /pin