Skip to main content

Summary

Move a paragraph within the same story to a new anchor paragraph (before or after). Cross-story and relationship-bearing moves reject with named reasons. Tracked-mode authoring emits paired <w:moveFrom> / <w:moveTo> review state with explicit move range marker identity; safe content (no comment/bookmark/permission anchors and no pre-existing tracked wrappers) is required for tracked authoring. Available on v2-backed sessions only; v1-backed sessions currently return CAPABILITY_UNAVAILABLE.
  • Operation ID: blocks.move
  • API member path: editor.doc.blocks.move(...)
  • Mutates document: yes
  • Idempotency: non-idempotent
  • Supports tracked mode: yes
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a BlocksMoveResult; on success carries the moved paragraph address plus affectedStories and a txId. Tracked-mode results include trackedChangeRefs pointing at the paired move review entity.

Input fields

FieldTypeRequiredDescription
destinationBlockNodeAddressyesBlockNodeAddress
destination.kind"block"yesConstant: "block"
destination.nodeIdstringyes
destination.nodeTypeenumyes"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"
destination.storyStoryLocatornoStoryLocator
placementenumyes"before", "after"
sourceBlockNodeAddressyesBlockNodeAddress
source.kind"block"yesConstant: "block"
source.nodeIdstringyes
source.nodeTypeenumyes"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"
source.storyStoryLocatornoStoryLocator

Example request

{
  "destination": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  },
  "placement": "before",
  "source": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  }
}

Output fields

FieldTypeRequiredDescription
affectedStoriesStoryLocator[]no
movedBlockNodeAddressyesBlockNodeAddress
moved.kind"block"yesConstant: "block"
moved.nodeIdstringyes
moved.nodeTypeenumyes"paragraph", "heading", "listItem", "table", "tableRow", "tableCell", "tableOfContents", "image", "sdt"
moved.storyStoryLocatornoStoryLocator
remappedRefsAffectedRefRemapping[]no
successtrueyesConstant: true
txIdstringno

Example response

{
  "affectedStories": [
    {
      "kind": "story",
      "storyType": "body"
    }
  ],
  "moved": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "paragraph",
    "story": {
      "kind": "story",
      "storyType": "body"
    }
  },
  "remappedRefs": [
    {
      "from": {
        "blockId": "block-abc123",
        "kind": "text",
        "range": {
          "end": 10,
          "start": 0
        },
        "story": {
          "kind": "story",
          "storyType": "body"
        }
      },
      "to": {
        "blockId": "block-abc123",
        "kind": "text",
        "range": {
          "end": 10,
          "start": 0
        },
        "story": {
          "kind": "story",
          "storyType": "body"
        }
      }
    }
  ],
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_TARGET
  • INVALID_INPUT

Non-applied failure codes

  • INVALID_TARGET
  • TARGET_NOT_FOUND
  • CAPABILITY_UNAVAILABLE
  • INVALID_CONTEXT
  • INVALID_INPUT

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "destination": {
      "$ref": "#/$defs/BlockNodeAddress"
    },
    "placement": {
      "enum": [
        "before",
        "after"
      ]
    },
    "source": {
      "$ref": "#/$defs/BlockNodeAddress"
    }
  },
  "required": [
    "source",
    "destination",
    "placement"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "affectedStories": {
      "items": {
        "$ref": "#/$defs/StoryLocator"
      },
      "type": "array"
    },
    "moved": {
      "$ref": "#/$defs/BlockNodeAddress"
    },
    "remappedRefs": {
      "items": {
        "$ref": "#/$defs/AffectedRefRemapping"
      },
      "type": "array"
    },
    "success": {
      "const": true
    },
    "txId": {
      "type": "string"
    }
  },
  "required": [
    "success",
    "moved"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "affectedStories": {
      "items": {
        "$ref": "#/$defs/StoryLocator"
      },
      "type": "array"
    },
    "moved": {
      "$ref": "#/$defs/BlockNodeAddress"
    },
    "remappedRefs": {
      "items": {
        "$ref": "#/$defs/AffectedRefRemapping"
      },
      "type": "array"
    },
    "success": {
      "const": true
    },
    "txId": {
      "type": "string"
    }
  },
  "required": [
    "success",
    "moved"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "TARGET_NOT_FOUND",
            "CAPABILITY_UNAVAILABLE",
            "INVALID_TARGET",
            "INVALID_INPUT"
          ]
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}