Google Slides lets users collaborate by adding comments on slides and page
elements.

This document shows how you can use the Google Slides API to programmatically read,
create, reply to, update, or delete comments.

## Read comments

When you use the
[`get`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/get) method on the
[`presentations`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations)
resource to retrieve a presentation, comment threads and anchors are omitted by
default.

To include comments in the response, set the
[`commentsViewMode`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations#Presentation.FIELDS.comments_view_mode)
query parameter to
[`COMMENTS_VIEW_MODE_INCLUDED`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentsViewMode).
Additionally, if the calling user has comments access on the file, then setting
the query parameter to `COMMENTS_VIEW_MODE_DEFAULT_FOR_CURRENT_ACCESS` also
returns comments.

Both the
[`comments`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations#Presentation.FIELDS.comments)
and
[`commentAnchors`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations.pages#Page.FIELDS.comment_anchors)
fields are returned in the response.

The following code sample shows how to use a `get` request that retrieves
comment threads and their anchors from a presentation:

    GET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID?commentsViewMode=COMMENTS_VIEW_MODE_INCLUDED&fields=presentationId,comments,slides(objectId,commentAnchors)

In the response, comments are returned in two locations:

- The global `comments` array containing the [`CommentThread`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentThread) objects.
- The `commentAnchors` array containing [`CommentAnchor`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations.pages#commentanchor) objects that map comment anchor IDs to page or page element locations (object anchors).

### Read comments on a specific page

You can also retrieve comments and anchors for a specific page using the
[`pages.get`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations.pages/get) method on the
[`presentations.pages`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations.pages) resource.
Set the `commentsViewMode` query parameter to include comments for the specific page target:

    GET https://slides.googleapis.com/v1/presentations/PRESENTATION_ID/pages/PAGE_ID?commentsViewMode=COMMENTS_VIEW_MODE_INCLUDED&fields=objectId,comments,commentAnchors

### Sample response

The following JSON sample response shows a comment thread anchored to a text range within a shape on a slide page:

    {
      "presentationId": "PRESENTATION_ID",
      "slides": [
        {
          "objectId": "SLIDE_PAGE_ID",
          "commentAnchors": [
            {
              "anchorId": "ANCHOR_ID",
              "objectAnchors": [
                {
                  "objectId": "SHAPE_OBJECT_ID",
                  "shapeTextAnchors": {
                    "ranges": [
                      {
                        "startIndex": 0,
                        "endIndex": 12
                      }
                    ]
                  }
                }
              ]
            }
          ]
        }
      ],
      "comments": [
        {
          "commentId": "COMMENT_ID",
          "anchorId": "ANCHOR_ID",
          "headPost": {
            "postId": "POST_ID",
            "content": "This is a comment thread head post.",
            "contentHtml": "The content of the post as HTML.",
            "author": {
              "displayName": "DISPLAY_NAME",
              "me": true,
              "user": "users/USER"
            },
            "createTime": "2026-07-01T10:13:12Z",
            "updateTime": "2026-07-01T10:13:12Z"
          },
          "replies": [
            {
              "postId": "REPLY_POST_ID",
              "content": "This is a reply to the comment.",
              "author": {
                "displayName": "DISPLAY_NAME",
                "me": false
              },
              "createTime": "2026-07-01T10:15:00Z",
              "updateTime": "2026-07-01T10:15:00Z"
            }
          ],
          "status": "OPEN"
        }
      ],
      "commentsViewMode": "COMMENTS_VIEW_MODE_INCLUDED"
    }

## Create and manage comments

You can programmatically add, edit, and delete comments or replies using the
[`batchUpdate`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate)
method on the
[`presentations`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations)
resource.

When performing batch updates involving comments, you should monitor for
potential partial failures. For more information, see [Comment update
status](https://developers.google.com/workspace/slides/api/guides/comments#update-status).

### Insert a comment

To insert a comment thread into a presentation, use the
[`InsertCommentRequest`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#insertcommentrequest)
object. You must provide the comment text contents and the anchor location. The
anchor location must specify one of the following:

- [`objectId`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertCommentRequest.FIELDS.object_id): The object ID of a slide page or a page element (such as a shape or table) to anchor the comment to.
- [`shapeTextAnchor`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertCommentRequest.FIELDS.shape_text_anchor): Anchors a comment to a range of text in a shape.
- [`tableCellTextAnchor`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertCommentRequest.FIELDS.table_cell_text_anchor): Anchors a comment to a range of text in a table cell.
- [`tableAnchor`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertCommentRequest.FIELDS.table_anchor): Anchors a comment to a range of cells in a table.

The following JSON sample shows how to add a comment thread anchored to a slide
page:

    {
      "requests": [
        {
          "insertComment": {
            "content": "This is a comment added using the API.",
            "objectId": "SLIDE_PAGE_ID"
          }
        }
      ]
    }

You can assign a comment to a specific user by providing their email in the
[`assigneeEmailAddress`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertCommentRequest.FIELDS.assignee_email_address)
field:

    {
      "requests": [
        {
          "insertComment": {
            "content": "Please review this slide.",
            "assigneeEmailAddress": "ASSIGNEE_EMAIL_ADDRESS",
            "objectId": "SLIDE_PAGE_ID"
          }
        }
      ]
    }

### Add a reply or take action

To reply to a comment thread, resolve, or reopen a thread, use the
[`AddCommentReplyRequest`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#addcommentreplyrequest)
object.

You must provide the
[`commentId`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#AddCommentReplyRequest.FIELDS.comment_id)
and the
[`post`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#AddCommentReplyRequest.FIELDS.post)
where the reply is represented by a
[`Post`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentThread#post) object.

The `Post` object contains the reply `content` and can optionally specify a
[`commentAction`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentThread#Post.FIELDS.comment_action)
(including the action to `RESOLVE` or `REOPEN` the comment thread). It's
represented by a
[`CommentActionType`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentThread#commentactiontype)
object.

You can also re-assign a comment thread by specifying a new `assigneeEmail` in
the `Post` object.

The following JSON sample shows how to reply to an existing comment thread:

    {
      "requests": [
        {
          "addCommentReply": {
            "commentId": "COMMENT_ID",
            "post": {
              "content": "Replying to the comment thread."
            }
          }
        }
      ]
    }

The following JSON sample shows how to resolve a comment thread:

    {
      "requests": [
        {
          "addCommentReply": {
            "commentId": "COMMENT_ID",
            "post": {
              "commentAction": "RESOLVE"
            }
          }
        }
      ]
    }

### Edit a post

To edit the text content of a post you authored, use the
[`UpdateCommentPostRequest`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#updatecommentpostrequest)
object. You must specify the `commentId` of the thread, the `postId` of the post
you want to edit, and the new plain text
[`content`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#UpdateCommentPostRequest.FIELDS.content).

The following JSON sample shows how to edit a post:

    {
      "requests": [
        {
          "updateCommentPost": {
            "commentId": "COMMENT_ID",
            "postId": "POST_ID",
            "content": "This is the updated comment text."
          }
        }
      ]
    }

### Delete comments and replies

To delete comments and replies, you have two options:

- **Delete a comment thread:** To remove an entire
  [`CommentThread`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentThread),
  use the
  [`DeleteCommentRequest`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#deletecommentrequest)
  object. You can only delete a comment thread if you're the author of the
  thread's
  [`headPost`](https://developers.google.com/workspace/slides/api/reference/rest/v1/CommentThread#FIELDS.head_post)
  in the `CommentThread` object.

- **Delete a reply:** To delete a specific reply `Post` from a
  `CommentThread`, use the
  [`DeleteCommentReplyRequest`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#deletecommentreplyrequest)
  object. You can only delete replies you authored. You cannot delete reply
  posts that contain a `commentAction` or an `assigneeEmail`.

The following JSON sample shows how to delete a comment thread:

    {
      "requests": [
        {
          "deleteComment": {
            "commentId": "COMMENT_ID"
          }
        }
      ]
    }

## Comment update status

Requests that require saving comment threads (such as inserting comments or
adding replies) might experience partial failures. In these cases, the
presentation model changes (such as updating slide content or backgrounds) might
be successfully committed, but the associated comments might fail to save.

You can verify whether comment updates were successfully applied by checking the
[`commentUpdateState`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate#body.BatchUpdatePresentationResponse.FIELDS.comment_update_state)
field in the response body of the `presentations.batchUpdate` method. The field
is represented by a
[`CommentUpdateState`](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate#commentupdatestate)
object.

The following states are returned in `CommentUpdateState`:

- `NO_UPDATES_REQUESTED`: No comment updates were requested in the batch operation.
- `ALL_SAVED`: All requested comment updates were successfully applied.
- `ALL_FAILED_UNKNOWN_REASON`: All requested comment updates failed to save, even though other presentation changes might have been committed.