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

# protection.setEditingRestriction

> Enable Word-style editing restriction on the document. Only readOnly mode is supported in v1.

## Summary

Enable Word-style editing restriction on the document. Only readOnly mode is supported in v1.

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

## Expected result

Returns a ProtectionMutationResult with the updated protection state on success.

## Input fields

| Field                  | Type    | Required | Description  |
| ---------------------- | ------- | -------- | ------------ |
| `formattingRestricted` | boolean | no       |              |
| `mode`                 | enum    | yes      | `"readOnly"` |

### Example request

```json theme={null}
{
  "formattingRestricted": true,
  "mode": "readOnly"
}
```

## Output fields

*No fields.*

### Example response

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

## Pre-apply throws

* `INVALID_INPUT`
* `CAPABILITY_UNAVAILABLE`

## Non-applied failure codes

* `NO_OP`

## Raw schemas

<Accordion title="Raw input schema">
  ```json theme={null}
  {
    "additionalProperties": false,
    "properties": {
      "formattingRestricted": {
        "type": "boolean"
      },
      "mode": {
        "enum": [
          "readOnly"
        ],
        "type": "string"
      }
    },
    "required": [
      "mode"
    ],
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw output schema">
  ```json theme={null}
  {
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw success schema">
  ```json theme={null}
  {
    "type": "object"
  }
  ```
</Accordion>

<Accordion title="Raw failure schema">
  ```json theme={null}
  {
    "type": "object"
  }
  ```
</Accordion>
