**Version: 202601**

# Revert AI card operation

**POST** `/openapi/2026-01/themes/edit-sessions/:oseid/gen-blocks/revert`

Restore the card to its state before the operation identified by `revert_id` (returned by any create, update, delete, or revert). Reverting also returns a new `revert_id`, so you can undo and redo repeatedly.

## Request

**Path Parameters**

- `oseid` string (required)

  Edit session ID

**application/json**

**Body | Example**

**Body (required)**

- `revert_id` string

  32-character token taken from any write response (create / update / delete / revert itself); pass it back as-is. The same id may be used repeatedly
- `revert_ids` string[]

  Batch form of `revert_id`, at most 20. Executed in array order. Takes precedence when both are given; at least one of the two is required

```json
{
  "revert_id": "string",
  "revert_ids": [
    "string"
  ]
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `data` object[]

    Result of each `revert_id`, in request order

    *   Array [

    - `revert_id` string

      The revert ID
    - `result` string

      `success`: reverted; `b_record_not_found`: the id does not exist or belongs to another edit session; `skipped`: not executed because an earlier item failed; `error:<detail>`: unexpected error, this item was rolled back. Execution stops at the first failure; items that already succeeded are not rolled back
    - `new_revert_id` string

      ID for redoing this step; only present on `success`
    - `changed` object[]

      Files changed by this step. Only present on `success`; empty when the same id is reverted again

      *   Array [

      - `type` string

        File directory, e.g. `templates`
      - `location` string

        File name, e.g. `index.json`
      - `action` string

        `updated`: content restored; `removed`: file removed
      *   ]
    *   ]

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "data": [
      {
        "revert_id": "string",
        "result": "string",
        "new_revert_id": "string",
        "changed": [
          {
            "type": "string",
            "location": "string",
            "action": "string"
          }
        ]
      }
    ]
  }
}
```
