Skip to main content

Summary

Accept or reject tracked changes by logical id, by selected text range, by logical anchor range ({ anchor, relativeStart, relativeEnd }), or every active change in the document. Range targets may include overlap / side selectors and may partially resolve a change, splitting surviving content into new fragments with stable ids. Legacy \{ id, range: \{ kind: "partial", ... \} \} targets are promoted only when the active adapter supports decide(); legacy fallback adapters fail closed with INVALID_INPUT. input.expectedRevision is accepted as a compatibility alias for mutation options.
  • Operation ID: trackChanges.decide
  • API member path: editor.doc.trackChanges.decide(...)
  • Mutates document: yes
  • Idempotency: conditional
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a Receipt. removed lists retired tracked-change ids; inserted lists successor fragment ids produced by partial range splits; invalidatedRefs lists every retired tracked-change ref plus cascade-deleted comment ids; remappedRefs carries surviving comment anchors moved by the decision; affectedStories lists touched stories; textRangeShifts reports per-story visible-text deltas; txId correlates with history. Failures: SPAN_FRAGMENTED when a range crosses an indivisible boundary, CAPABILITY_UNAVAILABLE for formatting / structural / move targets (not yet supported), TARGET_NOT_FOUND for retired ids or zero overlap, STALE_REVISION for stale expectedRevision, REVISION_MISMATCH for stale range coverage, NO_OP when { kind: ‘all’ } resolves an empty target set.

Input fields

Example request

Output fields

Variant 1 (success=true)

Variant 2 (success=false)

Example response

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_INPUT
  • INVALID_TARGET

Non-applied failure codes

  • NO_OP
  • INVALID_INPUT
  • INVALID_TARGET
  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • PERMISSION_DENIED
  • PRECONDITION_FAILED
  • COMMENT_CASCADE_PARTIAL
  • SPAN_FRAGMENTED
  • STALE_REVISION
  • REVISION_MISMATCH

Raw schemas