Search + K

Command Palette

Search for a command to run...

Sign In

Google Slides is organized around a single central resource: the presentation. A presentation contains an ordered list of pages (slides), and each page contains page elements (shapes, text boxes, images, tables, etc.). Most work flows revolve around obtaining a presentationId, inspecting its pages to get pageObjectId and page-element IDs, and then applying mutations through a single mutation entry point that accepts an ordered list of requests.

Domain model and IDs you need to know

  • Presentation: identified by presentationId. Almost every operation that reads or writes content requires this ID.
  • Page (slide): each slide is a page with an objectId (called pageObjectId in page-scoped operations). Use the page object ID to retrieve a single slide (pages.get) or get its thumbnail (pages.getThumbnail).
  • Page elements: shapes, text boxes, images, and tables within a page each have an objectId inside the page representation returned by presentations.get.

Where to find IDs: call presentations.get to fetch the whole presentation; its slides array lists each page and the nested pageElements list each element with their object IDs. Use those IDs when targeting specific slides or elements in subsequent calls.

Entry points — what to call first

  • Create a new presentation: call presentations.create with an optional request body (for example, a title). The response contains the newly created presentation and its presentationId.
  • Inspect an existing presentation: call presentations.get with presentationId. This returns the presentation structure including slides (pages) and their pageElements and object IDs. Use this as the starting point for anything that needs page or element IDs.
  • Read a single page: use presentations.pages.get with presentationId and pageObjectId when you only need one slide's content.
  • Get a slide thumbnail: use presentations.pages.getThumbnail with presentationId and pageObjectId. Thumbnail options (mime type and size) are provided via the thumbnailProperties.* query fields.
  • Mutate a presentation: use presentations.batchUpdate with presentationId and a requests array describing the changes. All non-trivial edits go through this operation.

How to accomplish common user requests

These are the practical sequences that appear most often.

Create a new presentation and add content

  • Call presentations.create (include title if you want). Record the presentationId from the response.
  • Call presentations.batchUpdate against that presentationId with a requests array to add slides and content (for example: create a slide, create a shape or text box, and insert text). The batch accepts many request types; read the request-type definitions for the exact fields each request requires.
  • Inspect the BatchUpdatePresentationResponse replies to obtain any created object IDs returned for requests that create objects. If you need to use created objects inside the same batch, assign explicit object IDs in the creation requests (see gotchas below).

Add or change text on an existing slide

  • If you do not already have the pageObjectId, call presentations.get to find the slide's objectId and any target element's objectId.
  • Use presentations.batchUpdate with requests such as InsertText or ReplaceAllText (depending on whether you append or replace). Target the specific page element by objectId.

Insert an image into a slide

  • Ensure you have presentationId and the pageObjectId for the slide where the image should go.
  • Use presentations.batchUpdate with the image-creation request (the request accepts image source information and placement). The response replies include the created image objectId.

Duplicate or reorder slides

  • Use presentations.batchUpdate requests that duplicate a page or change object order. After the batch completes, the response contains replies indicating created object IDs and final structure; call presentations.get if you need the authoritative, updated presentation structure.

Retrieve a slide thumbnail for display

  • Call presentations.pages.getThumbnail with presentationId and pageObjectId. The thumbnail request accepts thumbnailProperties.mimeType (default PNG) and thumbnailProperties.thumbnailSize (defaults to server choice if omitted).

Extract text or element lists from a slide

  • Use presentations.pages.get for a single slide or presentations.get for the whole presentation. Inspect the pageElements array to find text runs, images, and their objectIds for subsequent edits.

BatchUpdate patterns and important gotchas

  • Single mutation entry point: almost all mutations use presentations.batchUpdate. Build a requests array where each entry is one mutation. The array is applied in order.

  • Atomic and ordered execution: the requests are executed in order as a single operation. If any request fails, the whole batch is rejected and no changes are applied. Plan multi-step edits accordingly.

  • Replies and created IDs: BatchUpdatePresentationResponse contains a replies array with results for requests that return data (for example, IDs of created objects). Those replies are available only after the batch completes.

  • Referencing objects inside the same batch: if a later request in the same requests array must target an object created earlier in that same batch, assign a stable objectId explicitly in the creation request. You cannot rely on using an ID returned in replies from earlier requests within the same batch because replies are only available after the entire batch finishes.

  • When to fetch the presentation vs. read replies: for many flows the replies from batchUpdate provide enough information (created IDs, etc.). If you need the full, canonical presentation state (reordered slides, layout changes, computed fields), call presentations.get after the batch completes to retrieve the authoritative structure.

Thumbnail and media notes

  • Default thumbnail behavior: if you do not set thumbnailProperties.mimeType, the server returns PNG. If you omit thumbnailProperties.thumbnailSize, the server selects a default size.
  • Query parameter naming: thumbnail options are passed as thumbnailProperties.mimeType and thumbnailProperties.thumbnailSize in the request query.
  • Binary vs. metadata responses: the operation supports different response formats; if you expect image content, check the operation's response format options (the API surface exposes alt/media behaviors via query parameters).

Practical checklist for reliability

  • Always obtain presentationId first (create or presentations.get) before attempting page-level operations.
  • Use presentations.get to discover pageObjectId and page-element objectIds before targeting them in mutations.
  • Compose mutations as an ordered requests array in presentations.batchUpdate. Read request-type definitions to supply the correct fields for each request you intend to use.
  • If subsequent requests in the same batch must target newly created objects, supply explicit objectId values when creating them.
  • After a batchUpdate, inspect replies for IDs that the API returns; call presentations.get when you need the complete updated presentation structure.

When to prefer pages.get over presentations.get

  • Use presentations.pages.get when you only need a single slide's content. It targets one page and avoids returning the entire presentation structure. Use presentations.get when you need the full list of slides, layouts, or to discover many object IDs in one call.

Summary

Treat presentationId as the anchor for all operations. Read slide and element IDs from presentations.get (or pages.get), perform mutations through presentations.batchUpdate (ordered and atomic), and remember to assign explicit object IDs if you must reference newly created objects within the same batch. Use pages.getThumbnail for slide images and tune the thumbnailProperties.* query fields when needed.