---
title: "POST /api/document/transaction"
method: POST
path: "/api/document/transaction"
---

# POST /api/document/transaction

`POST /api/document/transaction`

## Headers

- `Marimo-Session-Id` string, required

## Request body

- NotebookDocumentTransactionRequest
  - `changes` union[], required
    - union
      - CreateCell — Insert a new cell into the notebook.
        - `after` string, cell-id
        - `before` string, cell-id
        - `cellId` string, cell-id, required
        - `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
        - `name` string, required
        - `type` 'create-cell', required
      - DeleteCell — Remove a cell from the notebook.
        - `cellId` string, cell-id, required
        - `type` 'delete-cell', required
      - MoveCell — Reposition a cell in the notebook.
        - `after` string, cell-id
        - `before` string, cell-id
        - `cellId` string, cell-id, required
        - `type` 'move-cell', required
      - ReorderCells — Replace the full cell ordering. Cell IDs present in the document but missing from `cell_ids` are appended at the end. IDs not in the document are ignored.
        - `cellIds` CellId[], required
        - `type` 'reorder-cells', required
      - SetCode — Replace a cell's source code.
        - `cellId` string, cell-id, required
        - `code` string, required
        - `type` 'set-code', required
      - SetName — Rename a cell.
        - `cellId` string, cell-id, required
        - `name` string, required
        - `type` 'set-name', required
      - SetConfig — Replace a cell's config.
        - `cellId` string, cell-id, required
        - `column` integer, nullable, required
        - `disabled` boolean, required
        - `hideCode` boolean, required
        - `type` 'set-config', required

## Response `200`

Apply a document transaction

- SuccessResponse
  - `success` boolean

## Changes

- **2026-05-06** `0474c7a44994` — 5 breaking
  - the request property `changes/items/anyOf[subschema #7: SetConfig]/column` became required
  - the request property `changes/items/anyOf[subschema #7: SetConfig]/disabled` became required
  - the request property `changes/items/anyOf[subschema #7: SetConfig]/hideCode` became required
  - request property `changes/items/anyOf[subschema #7: SetConfig]/disabled` list-of-types was narrowed by removing types `null` from media type `application/json`
  - …1 more
- **2026-03-31** `41bba414df27` — 11 breaking
  - the `changes/items/anyOf[subschema #1: CreateCell]/after/anyOf[#/components/schemas/CellId]/` request property type/format changed from `string`/`` to `string`/`cell-id`
  - the `changes/items/anyOf[subschema #1: CreateCell]/before/anyOf[#/components/schemas/CellId]/` request property type/format changed from `string`/`` to `string`/`cell-id`
  - the `changes/items/anyOf[subschema #1: CreateCell]/cellId` request property type/format changed from `string`/`` to `string`/`cell-id`
  - the `changes/items/anyOf[subschema #2: DeleteCell]/cellId` request property type/format changed from `string`/`` to `string`/`cell-id`
  - …7 more
- **2026-03-26** `c0a3e83b6ffb` — 1 info
  - endpoint added
- **2026-03-18** `f29fa637d35b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/marimo-team/apis/marimo-api/changes/api/document/transaction/post.md)

---

[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)
