openapi: 3.1.0
info:
title: Google Books About Documents 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: Documents
description: Operations related to Documents
paths:
/v1/documents:
post:
tags:
- Documents
summary: Google Post Documents
description: Creates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document.
operationId: docs.documents.create
security:
- Oauth2:
- https://www.googleapis.com/auth/documents
Oauth2c:
- https://www.googleapis.com/auth/documents
- Oauth2:
- https://www.googleapis.com/auth/drive
Oauth2c:
- https://www.googleapis.com/auth/drive
- Oauth2:
- https://www.googleapis.com/auth/drive.file
Oauth2c:
- https://www.googleapis.com/auth/drive.file
parameters:
- 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
- in: header
name: Authorization
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Document'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Document'
x-api-evangelist-certified: '2025-07-20'
x-api-naftiko-published: '2025-07-20'
x-microcks-operation:
delay: 100
dispatcher: FALLBACK
dispatcherRules: SuccessExample
/v1/documents/{documentId}:
get:
tags:
- Documents
summary: Google Get Documents
description: Gets the latest version of the specified document.
operationId: docs.documents.get
security:
- Oauth2:
- https://www.googleapis.com/auth/documents
Oauth2c:
- https://www.googleapis.com/auth/documents
- Oauth2:
- https://www.googleapis.com/auth/documents.readonly
Oauth2c:
- https://www.googleapis.com/auth/documents.readonly
- Oauth2:
- https://www.googleapis.com/auth/drive
Oauth2c:
- https://www.googleapis.com/auth/drive
- Oauth2:
- https://www.googleapis.com/auth/drive.file
Oauth2c:
- https://www.googleapis.com/auth/drive.file
- Oauth2:
- https://www.googleapis.com/auth/drive.readonly
Oauth2c:
- https://www.googleapis.com/auth/drive.readonly
parameters:
- description: The ID of the document to retrieve.
in: path
name: documentId
required: true
schema:
type: string
- description: The suggestions view mode to apply to the document. This allows viewing the document with all suggestions inline, accepted or rejected. If one is not specified, DEFAULT_FOR_CURRENT_ACCESS is used.
in: query
name: suggestionsViewMode
schema:
enum:
- DEFAULT_FOR_CURRENT_ACCESS
- SUGGESTIONS_INLINE
- PREVIEW_SUGGESTIONS_ACCEPTED
- PREVIEW_WITHOUT_SUGGESTIONS
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
- in: header
name: Authorization
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Document'
x-api-evangelist-certified: '2025-07-20'
x-api-naftiko-published: '2025-07-20'
x-microcks-operation:
delay: 100
dispatcher: FALLBACK
dispatcherRules: SuccessExample
/v1/documents/{documentId}:batchUpdate:
post:
tags:
- Documents
summary: Google Post Documents Batch Update
description: 'Applies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies, the reply to the third request, and another empty reply, in that order. Because other users may be editing the document, the document might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the document should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically.'
operationId: docs.documents.batchUpdate
security:
- Oauth2:
- https://www.googleapis.com/auth/documents
Oauth2c:
- https://www.googleapis.com/auth/documents
- Oauth2:
- https://www.googleapis.com/auth/drive
Oauth2c:
- https://www.googleapis.com/auth/drive
- Oauth2:
- https://www.googleapis.com/auth/drive.file
Oauth2c:
- https://www.googleapis.com/auth/drive.file
parameters:
- description: The ID of the document to update.
in: path
name: documentId
required: true
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
- in: header
name: Authorization
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BatchUpdateDocumentRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/BatchUpdateDocumentResponse'
x-microcks-operation:
delay: 100
dispatcher: FALLBACK
dispatcherRules: SuccessExample
components:
schemas:
InsertSectionBreakRequest:
description: Inserts a section break at the given location. A newline character will be inserted before the section break.
properties:
endOfSegmentLocation:
$ref: '#/components/schemas/EndOfSegmentLocation'
description: Inserts a newline and a section break at the end of the document body. Section breaks cannot be inserted inside a footnote, header or footer. Because section breaks can only be inserted inside the body, the segment ID field must be empty.
location:
$ref: '#/components/schemas/Location'
description: Inserts a newline and a section break at a specific index in the document. The section break must be inserted inside the bounds of an existing Paragraph. For instance, it cannot be inserted at a table's start index (i.e. between the table and its preceding paragraph). Section breaks cannot be inserted inside a table, equation, footnote, header, or footer. Since section breaks can only be inserted inside the body, the segment ID field must be empty.
sectionType:
description: The type of section to insert.
enum:
- SECTION_TYPE_UNSPECIFIED
- CONTINUOUS
- NEXT_PAGE
type: string
type: object
BulletSuggestionState:
description: A mask that indicates which of the fields on the base Bullet have been changed in this suggestion. For any field set to true, there's a new suggested value.
properties:
listIdSuggested:
description: Indicates if there was a suggested change to the list_id.
type: boolean
nestingLevelSuggested:
description: Indicates if there was a suggested change to the nesting_level.
type: boolean
textStyleSuggestionState:
$ref: '#/components/schemas/TextStyleSuggestionState'
description: A mask that indicates which of the fields in text style have been changed in this suggestion.
type: object
AutoText:
description: A ParagraphElement representing a spot in the text that's dynamically replaced with content that can change over time, like a page number.
properties:
suggestedDeletionIds:
description: The suggested deletion IDs. If empty, then there are no suggested deletions of this content.
items:
type: string
type: array
suggestedInsertionIds:
description: The suggested insertion IDs. An AutoText may have multiple insertion IDs if it's a nested suggested change. If empty, then this is not a suggested insertion.
items:
type: string
type: array
suggestedTextStyleChanges:
additionalProperties:
$ref: '#/components/schemas/SuggestedTextStyle'
description: The suggested text style changes to this AutoText, keyed by suggestion ID.
type: object
textStyle:
$ref: '#/components/schemas/TextStyle'
description: The text style of this AutoText.
type:
description: The type of this auto text.
enum:
- TYPE_UNSPECIFIED
- PAGE_NUMBER
- PAGE_COUNT
type: string
type: object
TableCellLocation:
description: Location of a single cell within a table.
properties:
columnIndex:
description: The zero-based column index. For example, the second column in the table has a column index of 1.
format: int32
type: integer
rowIndex:
description: The zero-based row index. For example, the second row in the table has a row index of 1.
format: int32
type: integer
tableStartLocation:
$ref: '#/components/schemas/Location'
description: The location where the table starts in the document.
type: object
ParagraphStyle:
description: 'Styles that apply to a whole paragraph. Inherited paragraph styles are represented as unset fields in this message. A paragraph style''s parent depends on where the paragraph style is defined: * The ParagraphStyle on a Paragraph inherits from the paragraph''s corresponding named style type. * The ParagraphStyle on a named style inherits from the normal text named style. * The ParagraphStyle of the normal text named style inherits from the default paragraph style in the Docs editor. * The ParagraphStyle on a Paragraph element that''s contained in a table may inherit its paragraph style from the table style. If the paragraph style does not inherit from a parent, unsetting fields will revert the style to a value matching the defaults in the Docs editor.'
properties:
alignment:
description: The text alignment for this paragraph.
enum:
- ALIGNMENT_UNSPECIFIED
- START
- CENTER
- END
- JUSTIFIED
type: string
avoidWidowAndOrphan:
description: Whether to avoid widows and orphans for the paragraph. If unset, the value is inherited from the parent.
type: boolean
borderBetween:
$ref: '#/components/schemas/ParagraphBorder'
description: The border between this paragraph and the next and previous paragraphs. If unset, the value is inherited from the parent. The between border is rendered when the adjacent paragraph has the same border and indent properties. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
borderBottom:
$ref: '#/components/schemas/ParagraphBorder'
description: The border at the bottom of this paragraph. If unset, the value is inherited from the parent. The bottom border is rendered when the paragraph below has different border and indent properties. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
borderLeft:
$ref: '#/components/schemas/ParagraphBorder'
description: The border to the left of this paragraph. If unset, the value is inherited from the parent. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
borderRight:
$ref: '#/components/schemas/ParagraphBorder'
description: The border to the right of this paragraph. If unset, the value is inherited from the parent. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
borderTop:
$ref: '#/components/schemas/ParagraphBorder'
description: The border at the top of this paragraph. If unset, the value is inherited from the parent. The top border is rendered when the paragraph above has different border and indent properties. Paragraph borders cannot be partially updated. When changing a paragraph border, the new border must be specified in its entirety.
direction:
description: The text direction of this paragraph. If unset, the value defaults to LEFT_TO_RIGHT since paragraph direction is not inherited.
enum:
- CONTENT_DIRECTION_UNSPECIFIED
- LEFT_TO_RIGHT
- RIGHT_TO_LEFT
type: string
headingId:
description: The heading ID of the paragraph. If empty, then this paragraph is not a heading. This property is read-only.
type: string
indentEnd:
$ref: '#/components/schemas/Dimension'
description: The amount of indentation for the paragraph on the side that corresponds to the end of the text, based on the current paragraph direction. If unset, the value is inherited from the parent.
indentFirstLine:
$ref: '#/components/schemas/Dimension'
description: The amount of indentation for the first line of the paragraph. If unset, the value is inherited from the parent.
indentStart:
$ref: '#/components/schemas/Dimension'
description: The amount of indentation for the paragraph on the side that corresponds to the start of the text, based on the current paragraph direction. If unset, the value is inherited from the parent.
keepLinesTogether:
description: Whether all lines of the paragraph should be laid out on the same page or column if possible. If unset, the value is inherited from the parent.
type: boolean
keepWithNext:
description: Whether at least a part of this paragraph should be laid out on the same page or column as the next paragraph if possible. If unset, the value is inherited from the parent.
type: boolean
lineSpacing:
description: The amount of space between lines, as a percentage of normal, where normal is represented as 100.0. If unset, the value is inherited from the parent.
format: float
type: number
namedStyleType:
description: The named style type of the paragraph. Since updating the named style type affects other properties within ParagraphStyle, the named style type is applied before the other properties are updated.
enum:
- NAMED_STYLE_TYPE_UNSPECIFIED
- NORMAL_TEXT
- TITLE
- SUBTITLE
- HEADING_1
- HEADING_2
- HEADING_3
- HEADING_4
- HEADING_5
- HEADING_6
type: string
pageBreakBefore:
description: Whether the current paragraph should always start at the beginning of a page. If unset, the value is inherited from the parent. Attempting to update page_break_before for paragraphs in unsupported regions, including Table, Header, Footer and Footnote, can result in an invalid document state that returns a 400 bad request error.
type: boolean
shading:
$ref: '#/components/schemas/Shading'
description: The shading of the paragraph. If unset, the value is inherited from the parent.
spaceAbove:
$ref: '#/components/schemas/Dimension'
description: The amount of extra space above the paragraph. If unset, the value is inherited from the parent.
spaceBelow:
$ref: '#/components/schemas/Dimension'
description: The amount of extra space below the paragraph. If unset, the value is inherited from the parent.
spacingMode:
description: The spacing mode for the paragraph.
enum:
- SPACING_MODE_UNSPECIFIED
- NEVER_COLLAPSE
- COLLAPSE_LISTS
type: string
tabStops:
description: A list of the tab stops for this paragraph. The list of tab stops is not inherited. This property is read-only.
items:
$ref: '#/components/schemas/TabStop'
type: array
type: object
TableCell:
description: The contents and style of a cell in a Table.
properties:
content:
description: The content of the cell.
items:
$ref: '#/components/schemas/StructuralElement'
type: array
endIndex:
description: The zero-based end index of this cell, exclusive, in UTF-16 code units.
format: int32
type: integer
startIndex:
description: The zero-based start index of this cell, in UTF-16 code units.
format: int32
type: integer
suggestedDeletionIds:
description: The suggested deletion IDs. If empty, then there are no suggested deletions of this content.
items:
type: string
type: array
suggestedInsertionIds:
description: The suggested insertion IDs. A TableCell may have multiple insertion IDs if it's a nested suggested change. If empty, then this is not a suggested insertion.
items:
type: string
type: array
suggestedTableCellStyleChanges:
additionalProperties:
$ref: '#/components/schemas/SuggestedTableCellStyle'
description: The suggested changes to the table cell style, keyed by suggestion ID.
type: object
tableCellStyle:
$ref: '#/components/schemas/TableCellStyle'
description: The style of the cell.
type: object
NestingLevel:
description: Contains properties describing the look and feel of a list bullet at a given level of nesting.
properties:
bulletAlignment:
description: The alignment of the bullet within the space allotted for rendering the bullet.
enum:
- BULLET_ALIGNMENT_UNSPECIFIED
- START
- CENTER
- END
type: string
glyphFormat:
description: The format string used by bullets at this level of nesting. The glyph format contains one or more placeholders, and these placeholders are replaced with the appropriate values depending on the glyph_type or glyph_symbol. The placeholders follow the pattern `%[nesting_level]`. Furthermore, placeholders can have prefixes and suffixes. Thus, the glyph format follows the pattern `%[nesting_level]`. Note that the prefix and suffix are optional and can be arbitrary strings. For example, the glyph format `%0.` indicates that the rendered glyph will replace the placeholder with the corresponding glyph for nesting level 0 followed by a period as the suffix. So a list with a glyph type of UPPER_ALPHA and glyph format `%0.` at nesting level 0 will result in a list with rendered glyphs `A.` `B.` `C.` The glyph format can contain placeholders for the current nesting level as well as placeholders for parent nesting levels. For example, a list can have a glyph format of `%0.` at nesting level 0 and a glyph format of `%0.%1.` at nesting level 1. Assuming both nesting levels have DECIMAL glyph types, this would result in a list with rendered glyphs `1.` `2.` ` 2.1.` ` 2.2.` `3.` For nesting levels that are ordered, the string that replaces a placeholder in the glyph format for a particular paragraph depends on the paragraph's order within the list.
type: string
glyphSymbol:
description: A custom glyph symbol used by bullets when paragraphs at this level of nesting are unordered. The glyph symbol replaces placeholders within the glyph_format. For example, if the glyph_symbol is the solid circle corresponding to Unicode U+25cf code point and the glyph_format is `%0`, the rendered glyph would be the solid circle.
type: string
glyphType:
description: The type of glyph used by bullets when paragraphs at this level of nesting are ordered. The glyph type determines the type of glyph used to replace placeholders within the glyph_format when paragraphs at this level of nesting are ordered. For example, if the nesting level is 0, the glyph_format is `%0.` and the glyph type is DECIMAL, then the rendered glyph would replace the placeholder `%0` in the glyph format with a number corresponding to list item's order within the list.
enum:
- GLYPH_TYPE_UNSPECIFIED
- NONE
- DECIMAL
- ZERO_DECIMAL
- UPPER_ALPHA
- ALPHA
- UPPER_ROMAN
- ROMAN
type: string
indentFirstLine:
$ref: '#/components/schemas/Dimension'
description: The amount of indentation for the first line of paragraphs at this level of nesting.
indentStart:
$ref: '#/components/schemas/Dimension'
description: The amount of indentation for paragraphs at this level of nesting. Applied to the side that corresponds to the start of the text, based on the paragraph's content direction.
startNumber:
description: The number of the first list item at this nesting level. A value of 0 is treated as a value of 1 for lettered lists and Roman numeral lists. For values of both 0 and 1, lettered and Roman numeral lists will begin at `a` and `i` respectively. This value is ignored for nesting levels with unordered glyphs.
format: int32
type: integer
textStyle:
$ref: '#/components/schemas/TextStyle'
description: The text style of bullets at this level of nesting.
type: object
DocumentStyleSuggestionState:
description: A mask that indicates which of the fields on the base DocumentStyle have been changed in this suggestion. For any field set to true, there's a new suggested value.
properties:
backgroundSuggestionState:
$ref: '#/components/schemas/BackgroundSuggestionState'
description: A mask that indicates which of the fields in background have been changed in this suggestion.
defaultFooterIdSuggested:
description: Indicates if there was a suggested change to default_footer_id.
type: boolean
defaultHeaderIdSuggested:
description: Indicates if there was a suggested change to default_header_id.
type: boolean
evenPageFooterIdSuggested:
description: Indicates if there was a suggested change to even_page_footer_id.
type: boolean
evenPageHeaderIdSuggested:
description: Indicates if there was a suggested change to even_page_header_id.
type: boolean
firstPageFooterIdSuggested:
description: Indicates if there was a suggested change to first_page_footer_id.
type: boolean
firstPageHeaderIdSuggested:
description: Indicates if there was a suggested change to first_page_header_id.
type: boolean
marginBottomSuggested:
description: Indicates if there was a suggested change to margin_bottom.
type: boolean
marginFooterSuggested:
description: Indicates if there was a suggested change to margin_footer.
type: boolean
marginHeaderSuggested:
description: Indicates if there was a suggested change to margin_header.
type: boolean
marginLeftSuggested:
description: Indicates if there was a suggested change to margin_left.
type: boolean
marginRightSuggested:
description: Indicates if there was a suggested change to margin_right.
type: boolean
marginTopSuggested:
description: Indicates if there was a suggested change to margin_top.
type: boolean
pageNumberStartSuggested:
description: Indicates if there was a suggested change to page_number_start.
type: boolean
pageSizeSuggestionState:
$ref: '#/components/schemas/SizeSuggestionState'
description: A mask that indicates which of the fields in size have been changed in this suggestion.
useCustomHeaderFooterMarginsSuggested:
description: Indicates if there was a suggested change to use_custom_header_footer_margins.
type: boolean
useEvenPageHeaderFooterSuggested:
description: Indicates if there was a suggested change to use_even_page_header_footer.
type: boolean
useFirstPageHeaderFooterSuggested:
description: Indicates if there was a suggested change to use_first_page_header_footer.
type: boolean
type: object
EndOfSegmentLocation:
description: Location at the end of a body, header, footer or footnote. The location is immediately before the last newline in the document segment.
properties:
segmentId:
description: The ID of the header, footer or footnote the location is in. An empty segment ID signifies the document's body.
type: string
type: object
CreateFootnoteRequest:
description: Creates a Footnote segment and inserts a new FootnoteReference to it at the given location. The new Footnote segment will contain a space followed by a newline character.
properties:
endOfSegmentLocation:
$ref: '#/components/schemas/EndOfSegmentLocation'
description: Inserts the footnote reference at the end of the document body. Footnote references cannot be inserted inside a header, footer or footnote. Since footnote references can only be inserted in the body, the segment ID field must be empty.
location:
$ref: '#/components/schemas/Location'
description: Inserts the footnote reference at a specific index in the document. The footnote reference must be inserted inside the bounds of an existing Paragraph. For instance, it cannot be inserted at a table's start index (i.e. between the table and its preceding paragraph). Footnote references cannot be inserted inside an equation, header, footer or footnote. Since footnote references can only be inserted in the body, the
# --- truncated at 32 KB (166 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/google/refs/heads/main/openapi/google-documents-api-openapi.yml