> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# history.undo

> Undo the most recent history-safe mutation in the document.

## Summary

Undo the most recent history-safe mutation in the document.

* Operation ID: `history.undo`
* API member path: `editor.doc.history.undo(...)`
* Mutates document: `yes`
* Idempotency: `non-idempotent`
* Supports tracked mode: `no`
* Supports dry run: `no`
* Deterministic target resolution: `yes`

## Expected result

Returns a HistoryActionResult with noop flag, reason (EMPTY\_UNDO\_STACK | NO\_EFFECT when noop), and revision before/after.

## Input fields

*No fields.*

### Example request

```json theme={null}
{}
```

## Output fields

| Field             | Type    | Required | Description |
| ----------------- | ------- | -------- | ----------- |
| `noop`            | boolean | yes      |             |
| `revision`        | object  | yes      |             |
| `revision.after`  | string  | yes      |             |
| `revision.before` | string  | yes      |             |

### Example response

```json theme={null}
{
  "noop": true,
  "revision": {
    "after": "example",
    "before": "example"
  }
}
```

## Pre-apply throws

* `CAPABILITY_UNAVAILABLE`

## Non-applied failure codes

* None

## Raw schemas

<Accordion title="Raw input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {},
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw output schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "noop": {
        "type": "boolean"
      },
      "revision": {
        "additionalProperties": false,
        "properties": {
          "after": {
            "type": "string"
          },
          "before": {
            "type": "string"
          }
        },
        "required": [
          "before",
          "after"
        ],
        "type": "object"
      }
    },
    "required": [
      "noop",
      "revision"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw success schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "noop": {
        "type": "boolean"
      },
      "revision": {
        "additionalProperties": false,
        "properties": {
          "after": {
            "type": "string"
          },
          "before": {
            "type": "string"
          }
        },
        "required": [
          "before",
          "after"
        ],
        "type": "object"
      }
    },
    "required": [
      "noop",
      "revision"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw failure schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "failure": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "enum": [
              "CAPABILITY_UNAVAILABLE"
            ]
          },
          "details": {},
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "success": {
        "const": false
      }
    },
    "required": [
      "success",
      "failure"
    ],
    "type": "object"
  }
  ```
</Accordion>
