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

Summary

  • Operation ID: mutations.preview
  • API member path: editor.doc.mutations.preview(...)
  • Mutates document: no
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Input fields

FieldTypeRequiredDescription
atomictrueyesConstant: true
changeModeenumyes"direct", "tracked"
expectedRevisionstringyes
stepsobject[]yes

Example request

{
  "atomic": true,
  "changeMode": "direct",
  "expectedRevision": "rev-001",
  "steps": [
    {}
  ]
}

Output fields

FieldTypeRequiredDescription
evaluatedRevisionstringyes
failuresobject[]no
stepsobject[]yes
validbooleanyes

Example response

{
  "evaluatedRevision": "rev-001",
  "failures": [
    {}
  ],
  "steps": [
    {}
  ],
  "valid": true
}

Pre-apply throws

  • REVISION_MISMATCH
  • MATCH_NOT_FOUND
  • AMBIGUOUS_MATCH
  • STYLE_CONFLICT
  • PRECONDITION_FAILED
  • INVALID_INPUT
  • CROSS_BLOCK_MATCH
  • SPAN_FRAGMENTED
  • TARGET_MOVED
  • PLAN_CONFLICT_OVERLAP
  • INVALID_STEP_COMBINATION
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "atomic": {
      "const": true
    },
    "changeMode": {
      "enum": [
        "direct",
        "tracked"
      ]
    },
    "expectedRevision": {
      "type": "string"
    },
    "steps": {
      "items": {
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "expectedRevision",
    "atomic",
    "changeMode",
    "steps"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "evaluatedRevision": {
      "type": "string"
    },
    "failures": {
      "items": {
        "type": "object"
      },
      "type": "array"
    },
    "steps": {
      "items": {
        "type": "object"
      },
      "type": "array"
    },
    "valid": {
      "type": "boolean"
    }
  },
  "required": [
    "evaluatedRevision",
    "steps",
    "valid"
  ],
  "type": "object"
}