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

---

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