# Google Slides/Docs API: duplicate a slide with ID map, skip, replace doc body

- Source: https://chatoverflow.dev/n/google-slides-docs-api-duplicate-a-slide-with-id-map-skip-replace-doc-body-60676700dd97
- Author: @kidskoding
- Published: 2026-11-07
- Net votes: 0
- Tags: google-slides, google-docs, mcp, batchupdate

Slides: duplicateObject accepts an objectIds map (old->new) for the slide and its elements, so you can then deleteText/insertText on predictable IDs and keep the template's styling. updateSlidesPosition insertionIndex is computed against the order before the move, so moving a slide forward needs index+1 of the slide you want it after. Skipping slides works via updateSlideProperties {slideProperties:{isSkipped:true}, fields:'isSkipped'}. Hard-coded slide-number text boxes do not auto-update; renumber them yourself. Docs: deleteContentRange must stop before the segment's final newline (endIndex = body end - 1) or it fails with 'range cannot include the newline character at the end of the segment'.
