Skip to main content
Alpha: Document API is currently alpha and subject to breaking changes.

Summary

Apply raw XML-level patches to the sdtPr subtree of a content control.
  • Operation ID: contentControls.patchRawProperties
  • API member path: editor.doc.contentControls.patchRawProperties(...)
  • Mutates document: yes
  • Idempotency: conditional
  • Supports tracked mode: no
  • Supports dry run: yes
  • Deterministic target resolution: yes

Expected result

Returns a ContentControlMutationResult; reports NO_OP if no effective changes.

Input fields

FieldTypeRequiredDescription
patchesobject[]yes
targetobject(nodeType=“sdt”)yes
target.kindenumyes"block", "inline"
target.nodeIdstringyes
target.nodeType"sdt"yesConstant: "sdt"

Example request

{
  "patches": [
    {}
  ],
  "target": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "sdt"
  }
}

Output fields

Variant 1 (success=true)

FieldTypeRequiredDescription
contentControlobject(nodeType=“sdt”)yes
contentControl.kindenumyes"block", "inline"
contentControl.nodeIdstringyes
contentControl.nodeType"sdt"yesConstant: "sdt"
successtrueyesConstant: true
updatedRefobject(nodeType=“sdt”)no
updatedRef.kindenumno"block", "inline"
updatedRef.nodeIdstringno
updatedRef.nodeType"sdt"noConstant: "sdt"

Variant 2 (success=false)

FieldTypeRequiredDescription
failureReceiptFailureyesReceiptFailure
failure.codestringyes
failure.detailsanyno
failure.messagestringyes
successfalseyesConstant: false

Example response

{
  "contentControl": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "sdt"
  },
  "success": true,
  "updatedRef": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "sdt"
  }
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_INPUT
  • REVISION_MISMATCH
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • NO_OP

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "patches": {
      "items": {
        "type": "object"
      },
      "type": "array"
    },
    "target": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "block",
            "inline"
          ]
        },
        "nodeId": {
          "type": "string"
        },
        "nodeType": {
          "const": "sdt"
        }
      },
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ],
      "type": "object"
    }
  },
  "required": [
    "target",
    "patches"
  ],
  "type": "object"
}
{
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "contentControl": {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "enum": [
                "block",
                "inline"
              ]
            },
            "nodeId": {
              "type": "string"
            },
            "nodeType": {
              "const": "sdt"
            }
          },
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ],
          "type": "object"
        },
        "success": {
          "const": true
        },
        "updatedRef": {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "enum": [
                "block",
                "inline"
              ]
            },
            "nodeId": {
              "type": "string"
            },
            "nodeType": {
              "const": "sdt"
            }
          },
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ],
          "type": "object"
        }
      },
      "required": [
        "success",
        "contentControl"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "$ref": "#/$defs/ReceiptFailure"
        },
        "success": {
          "const": false
        }
      },
      "required": [
        "success",
        "failure"
      ],
      "type": "object"
    }
  ]
}
{
  "additionalProperties": false,
  "properties": {
    "contentControl": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "block",
            "inline"
          ]
        },
        "nodeId": {
          "type": "string"
        },
        "nodeType": {
          "const": "sdt"
        }
      },
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ],
      "type": "object"
    },
    "success": {
      "const": true
    },
    "updatedRef": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "block",
            "inline"
          ]
        },
        "nodeId": {
          "type": "string"
        },
        "nodeType": {
          "const": "sdt"
        }
      },
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ],
      "type": "object"
    }
  },
  "required": [
    "success",
    "contentControl"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "$ref": "#/$defs/ReceiptFailure"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}