Deepnote research: our notes on building agents
Get started
All endpoint groups

Deepnote Public API v2

Runs API

Notebook executions.

Base URL

https://api.deepnote.com/v2

Run a notebook

post/runs

Request body

required
application/jsonobject
notebookIdrequiredstring

ID of the notebook to run.

detachedboolean

Run 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.

machineTypestring

Machine 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.

runDependentBlocksboolean

When true and `blockIds` is provided, also run downstream blocks that depend on the selected blocks.

inputsobject

Input 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
application/jsonCreateRunResponse
runIdrequiredstring:uuid
statusrequired"pending" | "running" | "success" | "error" | "internal_error" | "stopped"
createdAtrequiredstring:date-time
▸400Validation error, unknown machine type, or notebook/project issue
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Forbidden: insufficient live-editor permissions, not allowed to choose a machine type, AI usage denied, or agent-block restrictions
application/jsonErrorResponse
messagerequiredstring
▸409Notebook is already executing, plan machine limit reached, machine type not allowed by the plan, or pay-as-you-go disabled
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Hardware unable to start
application/jsonErrorResponse
messagerequiredstring

Get a run

get/runs/{runId}

Parameters

runIdpathrequiredstring:uuid
snapshotDeliveryquery"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
application/jsonGetRunResponse
runrequiredRun
▸400Validation error
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸404Run not found
application/jsonErrorResponse
messagerequiredstring
▸409Project is suspended
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring