> ## 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.get

> Query the current undo/redo history state of the document.

## Summary

Query the current undo/redo history state of the document.

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

## Expected result

Returns a HistoryState object with undoDepth, redoDepth, canUndo, canRedo, and a list of history-unsafe operations.

## Input fields

*No fields.*

### Example request

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

## Output fields

| Field                     | Type      | Required | Description |
| ------------------------- | --------- | -------- | ----------- |
| `canRedo`                 | boolean   | yes      |             |
| `canUndo`                 | boolean   | yes      |             |
| `historyUnsafeOperations` | string\[] | yes      |             |
| `redoDepth`               | integer   | yes      |             |
| `undoDepth`               | integer   | yes      |             |

### Example response

```json theme={null}
{
  "canRedo": true,
  "canUndo": true,
  "historyUnsafeOperations": [
    "example"
  ],
  "redoDepth": 1,
  "undoDepth": 1
}
```

## Pre-apply throws

* None

## 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": {
      "canRedo": {
        "type": "boolean"
      },
      "canUndo": {
        "type": "boolean"
      },
      "historyUnsafeOperations": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "redoDepth": {
        "minimum": 0,
        "type": "integer"
      },
      "undoDepth": {
        "minimum": 0,
        "type": "integer"
      }
    },
    "required": [
      "undoDepth",
      "redoDepth",
      "canUndo",
      "canRedo",
      "historyUnsafeOperations"
    ],
    "type": "object"
  }
  ```
</Accordion>
