# changes.snapshot

> Capture the current revision, change cursor and collaboration state vector so a verifier can later replay or compare change records against this point.



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

## Expected result

Returns a ChangesSnapshotResult with the revision, change cursor, last change id, base64 state vector, optional base64 full state and capture time.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "includeState": {
      "type": "boolean",
      "description": "Include the base64 Yjs v1 state update, deleted content included."
    }
  },
  "additionalProperties": false
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "revision": {
      "type": "string"
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastChangeId": {
      "type": [
        "string",
        "null"
      ]
    },
    "stateVector": {
      "type": "string",
      "description": "Base64 Yjs state vector. Empty when the session has no room document."
    },
    "state": {
      "type": "string"
    },
    "at": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "revision",
    "cursor",
    "lastChangeId",
    "stateVector",
    "at"
  ]
}
```

## Pre-apply throws

- `INVALID_INPUT`
- `CAPABILITY_UNAVAILABLE`

## Non-applied receipt codes

- None

