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

Summary

Replace content at a target position with new text or inline content.
  • Operation ID: replace
  • API member path: editor.doc.replace(...)
  • Mutates document: yes
  • Idempotency: conditional
  • Supports tracked mode: yes
  • Supports dry run: yes
  • Deterministic target resolution: yes

Expected result

Returns a TextMutationReceipt with applied status; receipt reports NO_OP if the target range already contains identical content.

Input fields

Example request

Output fields

Variant 1 (resolution.requestedTarget.kind=“text”)

Variant 2 (resolution.requestedTarget.kind=“text”)

Example response

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_TARGET

Non-applied failure codes

  • INVALID_TARGET
  • NO_OP

Raw schemas