insert_cells
Insert multiple notebook cells contiguously before a specified index with atomic validation. Returns new indices and revision for synchronization.
Instructions
Insert several cells at once, contiguously BEFORE index (0-based).
Prefer this over many insert_cell calls when adding a block of cells: one
round-trip, no index bookkeeping between inserts. cells is a list of
objects {cell_type, source, summary?} inserted in order (index == cell count
appends). The batch is atomic: all items are validated first, and if any is
invalid nothing is written and the offending items are named — fix those and
resend. Optionally pass expected_rev to guard against concurrent external
edits. Returns {"indices": [...], "ids": [...], "rev": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| cells | Yes | ||
| index | Yes | ||
| expected_rev | No |