# protection.get

> Read the current document protection state including editing restrictions, write protection, and read-only recommendation.



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

## Expected result

Returns a DocumentProtectionState with editingRestriction, writeProtection, and readOnlyRecommended fields.

## 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": {
    "editingRestriction": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "none",
            "readOnly",
            "comments",
            "trackedChanges",
            "forms"
          ]
        },
        "enforced": {
          "type": "boolean"
        },
        "runtimeEnforced": {
          "type": "boolean"
        },
        "passwordProtected": {
          "type": "boolean"
        },
        "formattingRestricted": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": [
        "mode",
        "enforced",
        "runtimeEnforced",
        "passwordProtected",
        "formattingRestricted"
      ]
    },
    "writeProtection": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "passwordProtected": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": [
        "enabled",
        "passwordProtected"
      ]
    },
    "readOnlyRecommended": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "editingRestriction",
    "writeProtection",
    "readOnlyRecommended"
  ]
}
```

## Pre-apply throws

- `CAPABILITY_UNAVAILABLE`

## Non-applied receipt codes

- None

