Skip to main content

Overview

The Google Slides API allows you to create, read, and update Google Slides presentations programmatically. API Name: slides
Version: v1
Official Documentation: Slides API Reference

Common Resources

Presentations

Create and manage Google Slides presentations.
presentationId
string
required
The presentation ID (found in the URL)
title
string
The presentation title

Pages (Slides)

Manage individual slides within a presentation.
presentationId
string
required
The presentation ID
pageObjectId
string
The slide object ID

Common Methods

Create Presentation

gws slides presentations create --json '{
  "title": "Q1 Results 2026"
}'
presentationId
string
The ID of the created presentation
title
string
The presentation title

Get Presentation

gws slides presentations get --params '{
  "presentationId": "1a2b3c4d5e6f7g8h9i"
}'
presentationId
string
The presentation ID
title
string
The presentation title
slides
array
Array of slide objects

Batch Update

gws slides presentations batchUpdate \
  --params '{"presentationId": "1a2b3c4d5e6f7g8h9i"}' \
  --json '{
    "requests": [
      {
        "createSlide": {
          "objectId": "slide001"
        }
      }
    ]
  }'

Presentation Operations

gws slides presentations batchUpdate \
  --params '{"presentationId": "1a2b3c4d5e6f7g8h9i"}' \
  --json '{
    "requests": [{
      "createSlide": {
        "objectId": "newSlide1",
        "insertionIndex": 1
      }
    }]
  }'

Response Format

Create presentation response:
{
  "presentationId": "1a2b3c4d5e6f7g8h9i",
  "title": "Q1 Results 2026",
  "slides": [
    {
      "objectId": "slide001",
      "slideProperties": {}
    }
  ],
  "pageSize": {
    "width": {"magnitude": 720, "unit": "EMU"},
    "height": {"magnitude": 540, "unit": "EMU"}
  }
}
Batch update response:
{
  "presentationId": "1a2b3c4d5e6f7g8h9i",
  "replies": [
    {
      "createSlide": {
        "objectId": "newSlide1"
      }
    }
  ]
}

Key Resources

  • presentations - Create, read, and update presentations
  • presentations.pages - Manage slides and layouts

Common Request Types

The batchUpdate method accepts various request types:
  • createSlide - Add a new slide
  • deleteObject - Delete a slide or element
  • createShape - Add shapes and text boxes
  • createImage - Insert images
  • createVideo - Embed videos
  • createTable - Insert tables
  • insertText - Add text to shapes
  • updateTextStyle - Format text
  • replaceAllText - Find and replace text
  • updateSlidesPosition - Reorder slides

Advanced Examples

Create Slide from Layout

gws slides presentations batchUpdate \
  --params '{"presentationId": "1a2b3c4d5e6f7g8h9i"}' \
  --json '{
    "requests": [{
      "createSlide": {
        "objectId": "newSlide2",
        "slideLayoutReference": {
          "predefinedLayout": "TITLE_AND_BODY"
        }
      }
    }]
  }'

Replace Placeholder Text

gws slides presentations batchUpdate \
  --params '{"presentationId": "1a2b3c4d5e6f7g8h9i"}' \
  --json '{
    "requests": [{
      "replaceAllText": {
        "containsText": {"text": "{{company}}"},
        "replaceText": "Acme Corp"
      }
    }]
  }'

Insert Chart from Sheets

gws slides presentations batchUpdate \
  --params '{"presentationId": "1a2b3c4d5e6f7g8h9i"}' \
  --json '{
    "requests": [{
      "createSheetsChart": {
        "spreadsheetId": "spreadsheet123",
        "chartId": 456,
        "linkingMode": "LINKED",
        "elementProperties": {
          "pageObjectId": "slide001"
        }
      }
    }]
  }'

Learn More

Schema Inspection

Before calling any method, inspect its schema:
gws schema slides.presentations.create
gws schema slides.presentations.batchUpdate