Skip to main content

Notebooks API

Notebook APIs manage Git-backed notebook workspaces, notebook files, supporting authoring files, notebook links, version history, kernel profiles, dedicated workers, and streamed cell execution.

info

All endpoints are mounted under /api/v1.0. Paths below omit that prefix for readability.

Base Path

/engagement/spaces/{space_slug}/notebooks

All endpoints require authentication and access to the target space.

Workspace Endpoints

MethodEndpointDescription
GET/engagement/spaces/{space_slug}/notebooks/workspacesList notebook workspaces.
POST/engagement/spaces/{space_slug}/notebooks/workspacesCreate a workspace.
PATCH/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}Update workspace metadata, default repository, visibility, owner, or query connectors.
GET/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/accessRead workspace sharing settings.
PUT/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/accessReplace workspace sharing settings.
POST/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/archiveArchive a workspace.

Workspace visibility is space, private, or shared. Shared workspaces can grant view or manage access to users and teams. Workspaces can also carry authoring_query_connector_ids for governed query access while authoring.

Create Workspace

{
"name": "Risk notebook review",
"default_repository_id": "repository-uuid",
"default_branch": "main",
"owner_user_id": "user-uuid",
"visibility": "shared",
"authoring_query_connector_ids": ["connector-uuid"]
}

Workspace File Endpoints

MethodEndpointDescription
GET/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/files?ref=mainList notebook files in a workspace repository branch.
POST/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/filesCreate a notebook file.
GET/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/file?ref=main&path=notebooks/a.ipynbRead a notebook file.
PUT/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/fileSave a notebook file and create a version record.
GET/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/authoring-file?ref=main&path=README.mdRead a notebook or text authoring file.
POST/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/authoring-filesCreate a notebook or text authoring file.
PUT/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/authoring-fileSave a notebook or text authoring file.
POST/engagement/spaces/{space_slug}/notebooks/workspaces/{workspace_id}/authoring-file/renameRename an authoring file.

Notebook payloads use Jupyter notebook JSON. Text authoring files use kind: "text" with content; notebook files use kind: "notebook" with notebook.

Save Notebook File

{
"path": "notebooks/risk-review.ipynb",
"branch": "main",
"base_sha": "optional-current-file-sha",
"notebook": {
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
},
"commit_message": "Update risk review notebook"
}

Repository File Compatibility

The API also exposes repository-addressed file endpoints for older clients:

MethodEndpointDescription
GET/engagement/spaces/{space_slug}/notebooks/repositories/{repository_id}/files?ref=mainList files by repository.
POST/engagement/spaces/{space_slug}/notebooks/repositories/{repository_id}/filesCreate a notebook by repository.
GET/engagement/spaces/{space_slug}/notebooks/repositories/{repository_id}/file?ref=main&path=notebooks/a.ipynbRead a notebook by repository.
PUT/engagement/spaces/{space_slug}/notebooks/repositories/{repository_id}/fileSave a notebook by repository.

Prefer workspace-addressed endpoints for new integrations.

MethodEndpointDescription
GET/engagement/spaces/{space_slug}/notebooks/documents/{notebook_id}/linksList links from a notebook to products, analyses, repositories, or use cases.
POST/engagement/spaces/{space_slug}/notebooks/documents/{notebook_id}/linksCreate a notebook link.
DELETE/engagement/spaces/{space_slug}/notebooks/documents/{notebook_id}/links/{link_id}Delete a notebook link.
GET/engagement/spaces/{space_slug}/notebooks/documents/{notebook_id}/versionsList saved Git versions for a notebook.

target_type is one of product, analysis, repository, or use_case.

Kernels, Workers, And Sessions

MethodEndpointDescription
GET/engagement/spaces/{space_slug}/notebooks/kernel-profilesList available kernel profiles.
GET/engagement/spaces/{space_slug}/notebooks/worker-resource-classesList enabled notebook worker resource classes.
GET/engagement/spaces/{space_slug}/notebooks/workersList current user's workers. Supports include_stopped and workspace_id.
POST/engagement/spaces/{space_slug}/notebooks/workersStart a dedicated notebook worker.
DELETE/engagement/spaces/{space_slug}/notebooks/workers/{worker_id}Stop a dedicated notebook worker.
POST/engagement/spaces/{space_slug}/notebooks/sessionsCreate a kernel session.
DELETE/engagement/spaces/{space_slug}/notebooks/sessions/{session_id}Delete a kernel session.
POST/engagement/spaces/{space_slug}/notebooks/sessions/{session_id}/interruptInterrupt session execution.
POST/engagement/spaces/{space_slug}/notebooks/sessions/{session_id}/restartRestart a session.
POST/engagement/spaces/{space_slug}/notebooks/sessions/{session_id}/execute/streamStream cell execution events as SSE.

Worker backends are docker, kubernetes, or external. Worker status is starting, ready, busy, stopping, stopped, or failed.

Start Worker Or Session

{
"workspace_id": "workspace-uuid",
"repository_kind": "analysis",
"branch": "main",
"path": "notebooks/risk-review.ipynb",
"kernel_name": "python3",
"kernel_profile_id": "python3",
"resource_class_id": "standard"
}

Execute Cell Stream

{
"code": "print('hello')",
"cell_index": 0
}

The response is text/event-stream. Normal execution events use the notebook_event event name. The stream ends with final_response or emits error with a safe message and status code.

Error Notes

StatusMeaning
400Invalid workspace settings, resource class settings, file path, or request payload.
403The user cannot view or manage the workspace or runtime.
404Workspace, repository, file, notebook, worker, or session was not found in the space.
409Git base SHA or worker/session state conflict.
503Runtime gateway, worker startup, or kernel execution dependency is unavailable.