Google Drive Comments API

The Comments API from Google Drive — 2 operation(s) for comments.

GitHub OpenAPI

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /drive/v3/files/{fileId}/comments/{commentId} Get a comment on a file · Get comments #
Ask an LLM
“Can I read a single comment on a file by its ID?”
“Is the original content of a deleted comment returned?”
Tell an agent
Get comment {commentId} on file {fileId}.
Show comment {commentId} on {fileId}, including deleted ones.
DELETE /drive/v3/files/{fileId}/comments/{commentId} Delete a comment on a file · Delete comments #
Ask an LLM
“How do I remove a comment from a file?”
“Can I delete a comment that has replies?”
Tell an agent destructive · confirm first
Delete comment {commentId} on file {fileId}.
Remove comment {commentId} from {fileId}.
PATCH /drive/v3/files/{fileId}/comments/{commentId} Edit a comment on a file · Update comments #
Ask an LLM
“Can I change the text of an existing comment?”
“How do I resolve a comment by updating it?”
Tell an agent
Change the content of comment {commentId} on file {fileId} to {content}.
Mark comment {commentId} on {fileId} as resolved.
GET /drive/v3/files/{fileId}/comments List comments on a file · List comments #
Ask an LLM
“What comments have been posted on a file?”
“Can I list only comments modified since a certain time?”
Tell an agent
List comments on file {fileId}.
Show comments on {fileId} modified after {startModifiedTime}.
POST /drive/v3/files/{fileId}/comments Comment on a file · Create comments #
Ask an LLM
“How do I leave a comment on a file?”
“Can I mention someone in a comment on a file?”
Tell an agent
Comment {content} on file {fileId}.
Add a comment on {fileId} mentioning {mentionedEmailAddresses}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-drive:google-drive-comments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-drive-comments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Google Drive Comments API
  version: v3
  description: Generated from Google's published Discovery document for Google Drive API (drive v3, revision 20261106). 5 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://www.googleapis.com
tags:
- name: Comments
paths:
  /drive/v3/files/{fileId}/comments/{commentId}:
    get:
      operationId: drive.comments.get
      summary: Get comments
      description: 'Gets a comment by ID. For more information, see Manage comments and replies. Required: The `fields` parameter must be set. To return the exact fields you need, see Return specific fields.'
      parameters:
      - name: fileId
        in: path
        required: true
        description: The ID of the file.
        schema:
          type: string
      - name: commentId
        in: path
        required: true
        description: The ID of the comment.
        schema:
          type: string
      - name: includeDeleted
        in: query
        required: false
        description: Whether to return deleted comments. Deleted comments will not include their original content.
        schema:
          default: 'false'
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/drive
        - https://www.googleapis.com/auth/drive.file
        - https://www.googleapis.com/auth/drive.meet.readonly
        - https://www.googleapis.com/auth/drive.readonly
      - apiKey: []
      tags:
      - Comments
    delete:
      operationId: drive.comments.delete
      summary: Delete comments
      description: Deletes a comment. For more information, see Manage comments and replies.
      parameters:
      - name: fileId
        in: path
        required: true
        description: The ID of the file.
        schema:
          type: string
      - name: commentId
        in: path
        required: true
        description: The ID of the comment.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/drive
        - https://www.googleapis.com/auth/drive.file
      - apiKey: []
      tags:
      - Comments
    patch:
      operationId: drive.comments.update
      summary: Update comments
      description: 'Updates a comment with patch semantics. For more information, see Manage comments and replies. Required: The `fields` parameter must be set. To return the exact fields you need, see Return specific fields.'
      parameters:
      - name: fileId
        in: path
        required: true
        description: The ID of the file.
        schema:
          type: string
      - name: commentId
        in: path
        required: true
        description: The ID of the comment.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Comment'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/drive
        - https://www.googleapis.com/auth/drive.file
      - apiKey: []
      tags:
      - Comments
  /drive/v3/files/{fileId}/comments:
    get:
      operationId: drive.comments.list
      summary: List comments
      description: 'Lists a file''s comments. For more information, see Manage comments and replies. Required: The `fields` parameter must be set. To return the exact fields you need, see Return specific fields.'
      parameters:
      - name: fileId
        in: path
        required: true
        description: The ID of the file.
        schema:
          type: string
      - name: includeDeleted
        in: query
        required: false
        description: Whether to include deleted comments. Deleted comments will not include their original content.
        schema:
          default: 'false'
          type: boolean
      - name: pageSize
        in: query
        required: false
        description: The maximum number of comments to return. The service may return fewer than this value. If unspecified, at most 20 comments will be returned. The maximum value is 100; values above 100 will be coerced to 100.
        schema:
          type: integer
          default: '20'
          maximum: 100
          format: int32
          minimum: 1
      - name: pageToken
        in: query
        required: false
        description: The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
        schema:
          type: string
      - name: startModifiedTime
        in: query
        required: false
        description: The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentList'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/drive
        - https://www.googleapis.com/auth/drive.file
        - https://www.googleapis.com/auth/drive.meet.readonly
        - https://www.googleapis.com/auth/drive.readonly
      - apiKey: []
      tags:
      - Comments
    post:
      operationId: drive.comments.create
      summary: Create comments
      description: 'Creates a comment on a file. For more information, see Manage comments and replies. Required: The `fields` parameter must be set. To return the exact fields you need, see Return specific fields.'
      parameters:
      - name: fileId
        in: path
        required: true
        description: The ID of the file.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Comment'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/drive
        - https://www.googleapis.com/auth/drive.file
      - apiKey: []
      tags:
      - Comments
components:
  schemas:
    CommentList:
      description: A list of comments on a file.
      properties:
        comments:
          type: array
          description: The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
          items:
            $ref: '#/components/schemas/Comment'
        kind:
          default: drive#commentList
          description: 'Identifies what kind of resource this is. Value: the fixed string `"drive#commentList"`.'
          type: string
        nextPageToken:
          description: The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
          type: string
      type: object
    Comment:
      properties:
        replies:
          items:
            $ref: '#/components/schemas/Reply'
          type: array
          description: Output only. The full list of replies to the comment in chronological order.
        resolved:
          description: Output only. Whether the comment has been resolved by one of its replies.
          type: boolean
        content:
          type: string
          description: The plain text content of the comment. This field is used for setting the content, while `htmlContent` should be displayed.
        modifiedTime:
          format: date-time
          description: The last time the comment or any of its replies was modified (RFC 3339 date-time).
          type: string
        author:
          $ref: '#/components/schemas/User'
          description: Output only. The author of the comment. The author's email address and permission ID will not be populated.
        deleted:
          description: Output only. Whether the comment has been deleted. A deleted comment has no content.
          type: boolean
        id:
          type: string
          description: Output only. The ID of the comment.
        kind:
          default: drive#comment
          type: string
          description: 'Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#comment"`.'
        assigneeEmailAddress:
          type: string
          readOnly: true
          description: Output only. The email address of the user assigned to this comment. If no user is assigned, the field is unset.
        quotedFileContent:
          properties:
            mimeType:
              type: string
              description: The MIME type of the quoted content.
            value:
              type: string
              description: The quoted content itself. This is interpreted as plain text if set through the API.
          type: object
          description: The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
        mentionedEmailAddresses:
          items:
            type: string
          description: Output only. A list of email addresses for users mentioned in this comment. If no users are mentioned, the list is empty.
          type: array
          readOnly: true
        htmlContent:
          type: string
          description: Output only. The content of the comment with HTML formatting.
        anchor:
          description: A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Manage comments and replies](https://developers.google.com/workspace/drive/api/v3/manage-comments).
          type: string
        createdTime:
          format: date-time
          description: The time at which the comment was created (RFC 3339 date-time).
          type: string
      description: A comment on a file. Some resource methods (such as `comments.update`) require a `commentId`. Use the `comments.list` method to retrieve the ID for a comment in a file.
      type: object
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    User:
      description: Information about a Drive user.
      properties:
        photoLink:
          type: string
          readOnly: true
          description: Output only. A link to the user's profile photo, if available.
        emailAddress:
          readOnly: true
          description: Output only. The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
          type: string
        kind:
          description: 'Output only. Identifies what kind of resource this is. Value: the fixed string `drive#user`.'
          default: drive#user
          type: string
          readOnly: true
        me:
          description: Output only. Whether this user is the requesting user.
          readOnly: true
          type: boolean
        displayName:
          type: string
          readOnly: true
          description: Output only. A plain text displayable name for this user.
        permissionId:
          type: string
          description: Output only. The user's ID as visible in Permission resources.
          readOnly: true
      type: object
    Reply:
      properties:
        action:
          description: 'The action the reply performed to the parent comment. The supported values are: * `resolve` * `reopen`'
          type: string
        kind:
          description: 'Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#reply"`.'
          type: string
          default: drive#reply
        id:
          type: string
          description: Output only. The ID of the reply.
        htmlContent:
          description: Output only. The content of the reply with HTML formatting.
          type: string
        assigneeEmailAddress:
          type: string
          readOnly: true
          description: Output only. The email address of the user assigned to this comment. If no user is assigned, the field is unset.
        createdTime:
          type: string
          description: The time at which the reply was created (RFC 3339 date-time).
          format: date-time
        mentionedEmailAddresses:
          readOnly: true
          description: Output only. A list of email addresses for users mentioned in this comment. If no users are mentioned, the list is empty.
          type: array
          items:
            type: string
        author:
          $ref: '#/components/schemas/User'
          description: Output only. The author of the reply. The author's email address and permission ID won't be populated.
        content:
          description: The plain text content of the reply. This field is used for setting the content, while `htmlContent` should be displayed. This field is required by the `create` method if no `action` value is specified.
          type: string
        modifiedTime:
          description: The last time the reply was modified (RFC 3339 date-time).
          format: date-time
          type: string
        deleted:
          description: Output only. Whether the reply has been deleted. A deleted reply has no content.
          type: boolean
      description: A reply to a comment on a file. Some resource methods (such as `replies.update`) require a `replyId`. Use the `replies.list` method to retrieve the ID for a reply.
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/drive.appdata: See, create, and delete its own configuration data in your Google Drive
            https://www.googleapis.com/auth/drive.readonly: See and download all your Google Drive files
            https://www.googleapis.com/auth/drive.photos.readonly: View the photos, videos and albums in your Google Photos
            https://www.googleapis.com/auth/drive.file: See, edit, create, and delete only the specific Google Drive files you use with this app
            https://www.googleapis.com/auth/drive.metadata.readonly: See information about your Google Drive files
            https://www.googleapis.com/auth/drive.meet.readonly: See and download your Google Drive files that were created or edited by Google Meet.
            https://www.googleapis.com/auth/drive: See, edit, create, and delete all of your Google Drive files
            https://www.googleapis.com/auth/drive.apps.readonly: View your Google Drive apps
            https://www.googleapis.com/auth/drive.metadata: View and manage metadata of files in your Google Drive
            https://www.googleapis.com/auth/drive.scripts: Modify your Google Apps Script scripts' behavior
externalDocs:
  url: https://developers.google.com/workspace/drive/
x-provenance:
  method: harvested
  publisher: Google
  source: https://www.googleapis.com/discovery/v1/apis/drive/v3/rest
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261106)