> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/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] Raw input schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {},
>   "type": "object"
> }
> ```

> [accordion] 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"
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.