---
title: "POST /api/kernel/scratchpad/run"
method: POST
path: "/api/kernel/scratchpad/run"
---

# POST /api/kernel/scratchpad/run

`POST /api/kernel/scratchpad/run`

## Headers

- `Marimo-Session-Id` string, required

## Request body

- ExecuteScratchpadRequest
  - `cellOutputs` CellOutputs — Per-cell output snapshot delivered alongside the document snapshot. `output` carries the cell's last main (rich display) output; `console_outputs` carries the buffered stdout/stderr stream from its last execution. Both are keyed by cell id; missing keys mean "no output captured" (the cell never ran, or produced nothing on that channel).
    - `console_outputs` object, required
    - `output` object, required
  - `code` string, required
  - `notebookCells` NotebookCell[], nullable
    - `code` string, required
    - `config` CellConfig, required — Internal representation of a cell's configuration. This is not part of the public API.
      - `column` integer, nullable
      - `disabled` boolean
      - `hide_code` boolean
    - `id` string, cell-id, required
    - `name` string, required
    - `version` integer
  - `request` HTTPRequest — Serializable HTTP request representation. Mimics Starlette/FastAPI Request but is pickle-able and contains only a safe subset of data. Excludes session and auth to prevent exposing sensitive data. Attributes: url: Serialized URL with path, port, scheme, netloc, query, hostname. base_url: Serialized base URL. headers: Request headers (marimo-specific headers excluded). query_params: Query parameters mapped to lists of values. path_params: Path parameters from the URL route. cookies: Request cookies. meta: User-defined storage for custom data. user: User info from authentication middleware (e.g., is_authenticated, username).
    - `base_url` object, required
    - `cookies` object, required
    - `headers` object, required
    - `meta` object, required
    - `path_params` object, required
    - `query_params` object, required
    - `url` object, required
    - `user` unknown, required
  - `runId` string, nullable

## Response `200`

Run the scratchpad

- SuccessResponse
  - `success` boolean

---

[API](https://skmtc.dev/marimo-team/apis/marimo-api.md) · [All operations](https://skmtc.dev/marimo-team/apis/marimo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/marimo-team/marimo-api/revisions/a39082aac3ce/schema)
