Skip to main content

Summary

Create a permission range exception region in the document. Inserts matched permStart/permEnd markers at the target.
  • Operation ID: permissionRanges.create
  • API member path: editor.doc.permissionRanges.create(...)
  • Mutates document: yes
  • Idempotency: non-idempotent
  • Supports tracked mode: no
  • Supports dry run: yes
  • Deterministic target resolution: yes

Expected result

Returns a PermissionRangeMutationResult with the created range info on success.

Input fields

FieldTypeRequiredDescription
idstringno
principalobjectyes
principal.idstringno
principal.kindenumyes"everyone", "editor"
targetSelectionTargetyesSelectionTarget
target.endSelectionPointyesSelectionPoint
target.kind"selection"yesConstant: "selection"
target.startSelectionPointyesSelectionPoint

Example request

{
  "id": "id-001",
  "principal": {
    "id": "id-001",
    "kind": "everyone"
  },
  "target": {
    "end": {
      "blockId": "block-abc123",
      "kind": "text",
      "offset": 0
    },
    "kind": "selection",
    "start": {
      "blockId": "block-abc123",
      "kind": "text",
      "offset": 0
    }
  }
}

Output fields

No fields.

Example response

{}

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_TARGET
  • INVALID_INPUT
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string"
    },
    "principal": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "everyone",
            "editor"
          ],
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "target": {
      "$ref": "#/$defs/SelectionTarget"
    }
  },
  "required": [
    "target",
    "principal"
  ],
  "type": "object"
}
{
  "type": "object"
}
{
  "type": "object"
}
{
  "type": "object"
}