Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Create a new content control (SDT) in the document.- Operation ID:
create.contentControl - API member path:
editor.doc.create.contentControl(...) - Mutates document:
yes - Idempotency:
non-idempotent - Supports tracked mode:
no - Supports dry run:
yes - Deterministic target resolution:
yes
Expected result
Returns a ContentControlMutationResult with the created content control target.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
alias | string | no | |
content | string | no | |
controlType | string | no | |
kind | enum | yes | "block", "inline" |
lockMode | enum | no | "unlocked", "sdtLocked", "contentLocked", "sdtContentLocked" |
tag | string | no | |
target | object(nodeType=“sdt”) | no | |
target.kind | enum | no | "block", "inline" |
target.nodeId | string | no | |
target.nodeType | "sdt" | no | Constant: "sdt" |
Example request
Output fields
Variant 1 (success=true)
| Field | Type | Required | Description |
|---|---|---|---|
contentControl | object(nodeType=“sdt”) | yes | |
contentControl.kind | enum | yes | "block", "inline" |
contentControl.nodeId | string | yes | |
contentControl.nodeType | "sdt" | yes | Constant: "sdt" |
success | true | yes | Constant: true |
updatedRef | object(nodeType=“sdt”) | no | |
updatedRef.kind | enum | no | "block", "inline" |
updatedRef.nodeId | string | no | |
updatedRef.nodeType | "sdt" | no | Constant: "sdt" |
Variant 2 (success=false)
| Field | Type | Required | Description |
|---|---|---|---|
failure | ReceiptFailure | yes | ReceiptFailure |
failure.code | string | yes | |
failure.details | any | no | |
failure.message | string | yes | |
success | false | yes | Constant: false |
Example response
Pre-apply throws
TARGET_NOT_FOUNDINVALID_TARGETAMBIGUOUS_TARGETINVALID_INPUTLOCK_VIOLATIONREVISION_MISMATCHCAPABILITY_UNAVAILABLE
Non-applied failure codes
INVALID_TARGETNO_OP
Raw schemas
Raw input schema
Raw input schema
Raw output schema
Raw output schema
Raw success schema
Raw success schema
Raw failure schema
Raw failure schema

