# history.get

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



- Member path: `doc.history.get(…)`
- Mutates document: no
- Idempotency: `idempotent`
- Supports tracked mode: no
- Supports dry run: no

## Expected result

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

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "undoDepth": {
      "type": "integer",
      "minimum": 0
    },
    "redoDepth": {
      "type": "integer",
      "minimum": 0
    },
    "canUndo": {
      "type": "boolean"
    },
    "canRedo": {
      "type": "boolean"
    },
    "historyUnsafeOperations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "undoDepth",
    "redoDepth",
    "canUndo",
    "canRedo",
    "historyUnsafeOperations"
  ]
}
```

## Pre-apply throws

- None

## Non-applied receipt codes

- None

