Deepnote Public API v2
Runs API
Notebook executions.
Base URL
https://api.deepnote.com/v2Run a notebook
/runsRequest body
objectnotebookIdrequiredstringID of the notebook to run.
detachedbooleanRun the notebook as a detached run so it does not affect the live editor session. Defaults to true; set to false to execute in the live editor kernel, reuse its state, and update outputs in the live app editor.
detachedRunStorageMode"read_write" | "readonly"Storage mode for the detached run. `read_write` (default) mounts project storage as writable; `readonly` mounts it as read-only so the run cannot modify the persistent project storage, but can create ephemeral files outside of the persistent project storage directory. Only applies to detached runs.
machineTypestringMachine type for the run, as an `id` from `GET /machine-types`. Defaults to the project's machine type. Only supported for detached runs.
blockIdsstring[]Optional non-empty list of unique block IDs to run. Only supported in live mode, so set `detached` to `false` when providing it. Omit to run the full notebook. Without `runDependentBlocks`, selected blocks run in request order except that selected input blocks with values in `inputs` run first. Input blocks with values in `inputs` that are not selected also run before the selected blocks.
runDependentBlocksbooleanWhen true and `blockIds` is provided, also run downstream blocks that depend on the selected blocks.
inputsobjectInput values used when this run executes, keyed by the input `name` returned from `GET /notebooks/{notebookId}`. Values must match the referenced input block type. In live mode (`detached: false`), these values can remain in the editor kernel and affect later executions until overwritten or the kernel is restarted. They do not change the notebook's saved input values.
Responses
▸202Run started
CreateRunResponserunIdrequiredstring:uuidstatusrequired"pending" | "running" | "success" | "error" | "internal_error" | "stopped"createdAtrequiredstring:date-time▸400Validation error, unknown machine type, or notebook/project issue
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Forbidden: insufficient live-editor permissions, not allowed to choose a machine type, AI usage denied, or agent-block restrictions
ErrorResponsemessagerequiredstring▸409Notebook is already executing, plan machine limit reached, machine type not allowed by the plan, or pay-as-you-go disabled
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Hardware unable to start
ErrorResponsemessagerequiredstringGet a run
/runs/{runId}Parameters
runIdpathrequiredstring:uuidsnapshotDeliveryquery"inline" | "downloadUrl" | "blocks"Controls how an available run snapshot is returned. Defaults to `downloadUrl`. Use `inline` to return `snapshotContent` directly, or `blocks` to return the executed blocks with their outputs as `snapshotBlocks`. Ignored for app viewer tokens.
fullOutputsquery"true" | "false"Return the outputs in `snapshotBlocks` as stored. By default, a block whose outputs are longer than 16384 characters as JSON gets a notice in their place, with `outputHead` and `outputTail` showing how they start and end. When a block runs, its printed output (stdout and stderr) keeps only the last 1000 lines or 600000 characters, whichever is shorter, and is marked `"truncated": true`. The dropped text isn't stored, so this option can't return it. Defaults to `false`. Applies only to `snapshotDelivery=blocks` and is ignored for app viewer tokens.
Responses
▸200Run details
GetRunResponserunrequiredRun▸400Validation error
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸404Run not found
ErrorResponsemessagerequiredstring▸409Project is suspended
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstring