Google Revisions API

Operations related to Revisions

OpenAPI Specification

google-revisions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Books About Revisions API
  description: API for retrieving Bookshelf and Volume resources from Google Books
  version: 1.0.0
  contact:
    name: Google Books API
    url: https://developers.google.com/books
servers:
- url: https://www.googleapis.com/books/v1
  description: Google Books API v1
tags:
- name: Revisions
  description: Operations related to Revisions
paths:
  /files/{fileId}/revisions:
    get:
      tags:
      - Revisions
      summary: Google Get Files Fileid Revisions
      description: Lists a file's revisions.
      operationId: googleDriveRevisionsList
      security:
      - Oauth2:
        - https://www.googleapis.com/auth/drive
        Oauth2c:
        - https://www.googleapis.com/auth/drive
      - Oauth2:
        - https://www.googleapis.com/auth/drive.appdata
        Oauth2c:
        - https://www.googleapis.com/auth/drive.appdata
      - Oauth2:
        - https://www.googleapis.com/auth/drive.file
        Oauth2c:
        - https://www.googleapis.com/auth/drive.file
      - Oauth2:
        - https://www.googleapis.com/auth/drive.metadata
        Oauth2c:
        - https://www.googleapis.com/auth/drive.metadata
      - Oauth2:
        - https://www.googleapis.com/auth/drive.metadata.readonly
        Oauth2c:
        - https://www.googleapis.com/auth/drive.metadata.readonly
      - Oauth2:
        - https://www.googleapis.com/auth/drive.photos.readonly
        Oauth2c:
        - https://www.googleapis.com/auth/drive.photos.readonly
      - Oauth2:
        - https://www.googleapis.com/auth/drive.readonly
        Oauth2c:
        - https://www.googleapis.com/auth/drive.readonly
      parameters:
      - description: The ID of the file.
        in: path
        name: fileId
        required: true
        schema:
          type: string
      - description: The maximum number of revisions to return per page.
        in: query
        name: pageSize
        schema:
          maximum: 1000
          minimum: 1
          type: integer
      - 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.
        in: query
        name: pageToken
        schema:
          type: string
      - in: header
        name: Authorization
        schema:
          type: string
      - description: V1 error format.
        in: query
        name: $.xgafv
        schema:
          enum:
          - '1'
          - '2'
          type: string
      - description: OAuth access token.
        in: query
        name: access_token
        schema:
          type: string
      - description: Data format for response.
        in: query
        name: alt
        schema:
          enum:
          - json
          - media
          - proto
          type: string
      - description: JSONP
        in: query
        name: callback
        schema:
          type: string
      - description: Selector specifying which fields to include in a partial response.
        in: query
        name: fields
        schema:
          type: string
      - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
        in: query
        name: key
        schema:
          type: string
      - description: OAuth 2.0 token for the current user.
        in: query
        name: oauth_token
        schema:
          type: string
      - description: Returns response with indentations and line breaks.
        in: query
        name: prettyPrint
        schema:
          type: boolean
      - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
        in: query
        name: quotaUser
        schema:
          type: string
      - description: Upload protocol for media (e.g. "raw", "multipart").
        in: query
        name: upload_protocol
        schema:
          type: string
      - description: Legacy upload protocol for media (e.g. "media", "multipart").
        in: query
        name: uploadType
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevisionList'
      x-api-evangelist-certified: '2025-07-18'
      x-api-naftiko-published: '2025-07-18'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /files/{fileId}/revisions/{revisionId}:
    get:
      tags:
      - Revisions
      summary: Google Get Files Fileid Revisions Revisionid
      description: Gets a revision's metadata or content by ID.
      operationId: googleDriveRevisionsGet
      security:
      - Oauth2:
        - https://www.googleapis.com/auth/drive
        Oauth2c:
        - https://www.googleapis.com/auth/drive
      - Oauth2:
        - https://www.googleapis.com/auth/drive.appdata
        Oauth2c:
        - https://www.googleapis.com/auth/drive.appdata
      - Oauth2:
        - https://www.googleapis.com/auth/drive.file
        Oauth2c:
        - https://www.googleapis.com/auth/drive.file
      - Oauth2:
        - https://www.googleapis.com/auth/drive.metadata
        Oauth2c:
        - https://www.googleapis.com/auth/drive.metadata
      - Oauth2:
        - https://www.googleapis.com/auth/drive.metadata.readonly
        Oauth2c:
        - https://www.googleapis.com/auth/drive.metadata.readonly
      - Oauth2:
        - https://www.googleapis.com/auth/drive.photos.readonly
        Oauth2c:
        - https://www.googleapis.com/auth/drive.photos.readonly
      - Oauth2:
        - https://www.googleapis.com/auth/drive.readonly
        Oauth2c:
        - https://www.googleapis.com/auth/drive.readonly
      parameters:
      - description: The ID of the file.
        in: path
        name: fileId
        required: true
        schema:
          type: string
      - description: The ID of the revision.
        in: path
        name: revisionId
        required: true
        schema:
          type: string
      - description: Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
        in: query
        name: acknowledgeAbuse
        schema:
          type: boolean
      - in: header
        name: Authorization
        schema:
          type: string
      - description: V1 error format.
        in: query
        name: $.xgafv
        schema:
          enum:
          - '1'
          - '2'
          type: string
      - description: OAuth access token.
        in: query
        name: access_token
        schema:
          type: string
      - description: Data format for response.
        in: query
        name: alt
        schema:
          enum:
          - json
          - media
          - proto
          type: string
      - description: JSONP
        in: query
        name: callback
        schema:
          type: string
      - description: Selector specifying which fields to include in a partial response.
        in: query
        name: fields
        schema:
          type: string
      - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
        in: query
        name: key
        schema:
          type: string
      - description: OAuth 2.0 token for the current user.
        in: query
        name: oauth_token
        schema:
          type: string
      - description: Returns response with indentations and line breaks.
        in: query
        name: prettyPrint
        schema:
          type: boolean
      - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
        in: query
        name: quotaUser
        schema:
          type: string
      - description: Upload protocol for media (e.g. "raw", "multipart").
        in: query
        name: upload_protocol
        schema:
          type: string
      - description: Legacy upload protocol for media (e.g. "media", "multipart").
        in: query
        name: uploadType
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Revision'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
    patch:
      tags:
      - Revisions
      summary: Google Patch Files Fileid Revisions Revisionid
      description: Updates a revision with patch semantics.
      operationId: googleDriveRevisionsUpdate
      security:
      - Oauth2:
        - https://www.googleapis.com/auth/drive
        Oauth2c:
        - https://www.googleapis.com/auth/drive
      - Oauth2:
        - https://www.googleapis.com/auth/drive.appdata
        Oauth2c:
        - https://www.googleapis.com/auth/drive.appdata
      - Oauth2:
        - https://www.googleapis.com/auth/drive.file
        Oauth2c:
        - https://www.googleapis.com/auth/drive.file
      parameters:
      - description: The ID of the file.
        in: path
        name: fileId
        required: true
        schema:
          type: string
      - description: The ID of the revision.
        in: path
        name: revisionId
        required: true
        schema:
          type: string
      - in: header
        name: Authorization
        schema:
          type: string
      - description: V1 error format.
        in: query
        name: $.xgafv
        schema:
          enum:
          - '1'
          - '2'
          type: string
      - description: OAuth access token.
        in: query
        name: access_token
        schema:
          type: string
      - description: Data format for response.
        in: query
        name: alt
        schema:
          enum:
          - json
          - media
          - proto
          type: string
      - description: JSONP
        in: query
        name: callback
        schema:
          type: string
      - description: Selector specifying which fields to include in a partial response.
        in: query
        name: fields
        schema:
          type: string
      - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
        in: query
        name: key
        schema:
          type: string
      - description: OAuth 2.0 token for the current user.
        in: query
        name: oauth_token
        schema:
          type: string
      - description: Returns response with indentations and line breaks.
        in: query
        name: prettyPrint
        schema:
          type: boolean
      - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
        in: query
        name: quotaUser
        schema:
          type: string
      - description: Upload protocol for media (e.g. "raw", "multipart").
        in: query
        name: upload_protocol
        schema:
          type: string
      - description: Legacy upload protocol for media (e.g. "media", "multipart").
        in: query
        name: uploadType
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Revision'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Revision'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
    delete:
      tags:
      - Revisions
      summary: Google Delete Files Fileid Revisions Revisionid
      description: Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.
      operationId: googleDriveRevisionsDelete
      security:
      - Oauth2:
        - https://www.googleapis.com/auth/drive
        Oauth2c:
        - https://www.googleapis.com/auth/drive
      - Oauth2:
        - https://www.googleapis.com/auth/drive.appdata
        Oauth2c:
        - https://www.googleapis.com/auth/drive.appdata
      - Oauth2:
        - https://www.googleapis.com/auth/drive.file
        Oauth2c:
        - https://www.googleapis.com/auth/drive.file
      parameters:
      - description: The ID of the file.
        in: path
        name: fileId
        required: true
        schema:
          type: string
      - description: The ID of the revision.
        in: path
        name: revisionId
        required: true
        schema:
          type: string
      - in: header
        name: Authorization
        schema:
          type: string
      - description: V1 error format.
        in: query
        name: $.xgafv
        schema:
          enum:
          - '1'
          - '2'
          type: string
      - description: OAuth access token.
        in: query
        name: access_token
        schema:
          type: string
      - description: Data format for response.
        in: query
        name: alt
        schema:
          enum:
          - json
          - media
          - proto
          type: string
      - description: JSONP
        in: query
        name: callback
        schema:
          type: string
      - description: Selector specifying which fields to include in a partial response.
        in: query
        name: fields
        schema:
          type: string
      - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
        in: query
        name: key
        schema:
          type: string
      - description: OAuth 2.0 token for the current user.
        in: query
        name: oauth_token
        schema:
          type: string
      - description: Returns response with indentations and line breaks.
        in: query
        name: prettyPrint
        schema:
          type: boolean
      - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
        in: query
        name: quotaUser
        schema:
          type: string
      - description: Upload protocol for media (e.g. "raw", "multipart").
        in: query
        name: upload_protocol
        schema:
          type: string
      - description: Legacy upload protocol for media (e.g. "media", "multipart").
        in: query
        name: uploadType
        schema:
          type: string
      responses:
        '200':
          description: Successful response
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
components:
  schemas:
    User:
      description: Information about a Drive user.
      properties:
        displayName:
          description: Output only. A plain text displayable name for this user.
          type: string
        emailAddress:
          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:
          default: drive#user
          description: 'Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#user"`.'
          type: string
        me:
          description: Output only. Whether this user is the requesting user.
          type: boolean
        permissionId:
          description: Output only. The user's ID as visible in Permission resources.
          type: string
        photoLink:
          description: Output only. A link to the user's profile photo, if available.
          type: string
      type: object
    Revision:
      description: The metadata for a revision to a file. Some resource methods (such as `revisions.update`) require a `revisionId`. Use the `revisions.list` method to retrieve the ID for a revision.
      properties:
        exportLinks:
          additionalProperties:
            type: string
          description: Output only. Links for exporting Docs Editors files to specific formats.
          type: object
        id:
          description: Output only. The ID of the revision.
          type: string
        keepForever:
          description: Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file. This field is only applicable to files with binary content in Drive.
          type: boolean
        kind:
          default: drive#revision
          description: 'Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#revision"`.'
          type: string
        lastModifyingUser:
          $ref: '#/components/schemas/User'
          description: Output only. The last user to modify this revision.
        md5Checksum:
          description: Output only. The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
          type: string
        mimeType:
          description: Output only. The MIME type of the revision.
          type: string
        modifiedTime:
          description: The last time the revision was modified (RFC 3339 date-time).
          format: date-time
          type: string
        originalFilename:
          description: Output only. The original filename used to create this revision. This is only applicable to files with binary content in Drive.
          type: string
        publishAuto:
          description: Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.
          type: boolean
        published:
          description: Whether this revision is published. This is only applicable to Docs Editors files.
          type: boolean
        publishedLink:
          description: Output only. A link to the published revision. This is only populated for Google Sites files.
          type: string
        publishedOutsideDomain:
          description: Whether this revision is published outside the domain. This is only applicable to Docs Editors files.
          type: boolean
        size:
          description: Output only. The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
          format: int64
          type: string
      type: object
    RevisionList:
      description: A list of revisions of a file.
      properties:
        kind:
          default: drive#revisionList
          description: 'Identifies what kind of resource this is. Value: the fixed string `"drive#revisionList"`.'
          type: string
        nextPageToken:
          description: The page token for the next page of revisions. This will be absent if the end of the revisions 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
        revisions:
          description: The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
          items:
            $ref: '#/components/schemas/Revision'
          type: array
      type: object
  securitySchemes:
    OAuth2:
      type: oauth2
      description: OAuth 2.0 authentication for Google Books API
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/books: Manage your Google Books library