**Version: 202601**

# Batch edit operations

**POST** `/openapi/2026-01/themes/edit-sessions/:oseid/files/:doc_id/operations`

Execute multiple edit operations in one request; each operation runs and is saved independently, and a failure on one does not stop the others.

## Request

**Path Parameters**

- `oseid` string (required)

  Edit session ID
- `doc_id` string (required)

  Document ID of the file within the session

**application/json**

**Body | Example**

**Body (required)**

- `operations` object[] (required)

  Ordered list of theme operations executed in one batch. Each op is applied and persisted independently, and a failure on one does not stop the others. See `ThemeOperation`.

  *   Array \[

  - `op` string (required)

    The operation to perform. One of: `add_section`, `remove_section`, `move_section`, `replace_props`, `set_visibility`, `append_array_item`, `remove_array_item`, `move_array_item`, `update_slot`, `replace_global`, `set_script_visibility`.
  - `target` string

    Path to the target card or block; its meaning depends on `op`. Pass a section's id to address a section, or a dotted path such as `sec1.blocks.0` (or deeper, `sec1.blocks.0.blocks.2`) to address a nested block. A leading `sections.` segment is also accepted (`sections.sec1.blocks.0`) — the same syntax the AI card `instances` field returns.
  - `value` GoogleProtobufValue

    The new card, block, or blocks-array content. Applies to `add_section`, `append_array_item`, and `update_slot`.
  - `props` object

    The settings fields to merge in. Applies to `replace_props` and `replace_global`.
  - `visible` boolean

    Target visibility: true shows, false hides. Applies to `set_visibility` and `set_script_visibility`. Omitting the field is treated as `false` (hide), never as "leave unchanged" — always send it explicitly.
  - `position` string

    Placement `before` or `after` the reference card. For `add_section` the reference is `target`; for `move_section` it is `move_target` (`target` is the card being moved).
  - `move_target` string

    Id of the reference card next to which the target is placed. Applies to `move_section`.
  - `section_id` string

    Explicit id for the new section. Applies to `add_section`; optional — the server generates one when omitted. Idempotent success when the id already exists with the same type.
  *   \]

```json
{
  "operations": [
    {
      "op": "string",
      "target": "string",
      "props": {},
      "visible": true,
      "position": "string",
      "move_target": "string",
      "section_id": "string"
    }
  ]
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `data` object[]

    The result of each operation.

    *   Array \[

    - `op` string

      The operation type, echoing the `op` of the corresponding request item.
    - `result` string

      Outcome of the operation: `success` if it succeeded, otherwise an error code (which may include a `:detail` suffix).
    *   \]

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "data": [
      {
        "op": "string",
        "result": "string"
      }
    ]
  }
}
```
