Skip to main content
Every googledocs.api.* operation is listed below with parameter shapes and return types from the plugin Zod schemas.
New to Corsair? See API access, authentication, and error handling.

Documents

copyDocument

documents.copyDocument Copy an existing Google Doc Risk: write
Input
NameTypeRequiredDescription
fileIdstringYes
namestringNo
parentsstring[]No
Output
NameTypeRequiredDescription
idstringNo
namestringNo
mimeTypestringNo
parentsstring[]No
trashedbooleanNo
createdTimestringNo
modifiedTimestringNo
webViewLinkstringNo
sizestringNo
ownersany[]No

createBlankDocument

documents.createBlankDocument Create a blank Google Doc [DEPRECATED: prefer documents.createDocument] Risk: write
Input
NameTypeRequiredDescription
titlestringYes
Output
NameTypeRequiredDescription
documentIdstringNo
titlestringNo
revisionIdstringNo
bodyanyNo
headersanyNo
footersanyNo
footnotesanyNo
inlineObjectsanyNo
positionedObjectsanyNo
namedRangesanyNo
listsanyNo
documentStyleanyNo
suggestionsViewModestringNo

createDocument

documents.createDocument Create a Google Doc with an optional title and initial text Risk: write
Input
NameTypeRequiredDescription
titlestringYes
textstringNo
Output
NameTypeRequiredDescription
documentIdstringNo
titlestringNo
revisionIdstringNo
bodyanyNo
headersanyNo
footersanyNo
footnotesanyNo
inlineObjectsanyNo
positionedObjectsanyNo
namedRangesanyNo
listsanyNo
documentStyleanyNo
suggestionsViewModestringNo

createDocumentMarkdown

documents.createDocumentMarkdown Create a Google Doc initialized from Markdown text Risk: write
Input
NameTypeRequiredDescription
titlestringNo
markdownstringYes
Output
NameTypeRequiredDescription
documentIdstringNo
titlestringNo
revisionIdstringNo
bodyanyNo
headersanyNo
footersanyNo
footnotesanyNo
inlineObjectsanyNo
positionedObjectsanyNo
namedRangesanyNo
listsanyNo
documentStyleanyNo
suggestionsViewModestringNo

exportDocumentAsPdf

documents.exportDocumentAsPdf Export a Google Doc as PDF (Drive enforces a 10MB limit) Risk: read
Input
NameTypeRequiredDescription
fileIdstringYes
Output
NameTypeRequiredDescription
fileIdstringYes
mimeTypestringYes
datastringYes

getDocument

documents.getDocument Retrieve a Google Doc by id Risk: read
Input
NameTypeRequiredDescription
documentIdstringYes
Output
NameTypeRequiredDescription
documentIdstringNo
titlestringNo
revisionIdstringNo
bodyanyNo
headersanyNo
footersanyNo
footnotesanyNo
inlineObjectsanyNo
positionedObjectsanyNo
namedRangesanyNo
listsanyNo
documentStyleanyNo
suggestionsViewModestringNo

getDocumentPlaintext

documents.getDocumentPlaintext Retrieve a Google Doc as best-effort plain text Risk: read
Input
NameTypeRequiredDescription
documentIdstringYes
Output
NameTypeRequiredDescription
documentIdstringYes
titlestringNo
textstringYes
wordCountnumberYes

listSpreadsheetCharts

documents.listSpreadsheetCharts List charts in a Google Sheets spreadsheet for embedding Risk: read
Input
NameTypeRequiredDescription
spreadsheetIdstringYes
Output
NameTypeRequiredDescription
spreadsheetIdstringNo
sheetsany[]No

searchDocuments

documents.searchDocuments Search Google Docs by name, content, or date filters Risk: read
Input
NameTypeRequiredDescription
qstringNo
pageSizenumberNo
pageTokenstringNo
orderBystringNo
Output
NameTypeRequiredDescription
kindstringNo
nextPageTokenstringNo
incompleteSearchbooleanNo
filesobject[]No

updateDocumentBatch

documents.updateDocumentBatch Apply batchUpdate edits [DEPRECATED: prefer documents.updateExistingDocument] Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
requestsobject[]Yes
writeControlobjectNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

updateDocumentMarkdown

documents.updateDocumentMarkdown Replace a Google Doc content with Markdown text Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
markdownstringYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

updateDocumentSectionMarkdown

documents.updateDocumentSectionMarkdown Replace a section of a Google Doc with Markdown text Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
markdownstringYes
startIndexnumberYes
endIndexnumberNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

updateDocumentStyle

documents.updateDocumentStyle Update the page size, margins, and global document style Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
documentStyleobjectYes
fieldsstringYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

updateExistingDocument

documents.updateExistingDocument Apply batchUpdate edits (insert/delete/format) to a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
requestsobject[]Yes
writeControlobjectNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

Structure

createFooter

structure.createFooter Create a footer Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
typeDEFAULT | FIRST_PAGE | EVEN_PAGENo
sectionBreakLocationobjectNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

createFootnote

structure.createFootnote Create a footnote Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
locationobjectNo
endOfSegmentLocationobjectNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

createHeader

structure.createHeader Create a header Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
typeDEFAULT | FIRST_PAGE | EVEN_PAGENo
sectionBreakLocationobjectNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

createNamedRange

structure.createNamedRange Create a named range Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
namestringYes
startIndexnumberYes
endIndexnumberYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

createParagraphBullets

structure.createParagraphBullets Add bullets to a range of paragraphs Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
startIndexnumberYes
endIndexnumberYes
bulletPresetstringNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

deleteFooter

structure.deleteFooter Delete a footer Risk: destructive
Input
NameTypeRequiredDescription
documentIdstringYes
footerIdstringYes
typeDEFAULT | FIRST_PAGE | EVEN_PAGENo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

deleteHeader

structure.deleteHeader Delete a header Risk: destructive
Input
NameTypeRequiredDescription
documentIdstringYes
headerIdstringYes
typeDEFAULT | FIRST_PAGE | EVEN_PAGENo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

deleteNamedRange

structure.deleteNamedRange Delete a named range by id or name Risk: destructive
Input
NameTypeRequiredDescription
documentIdstringYes
namedRangeIdstringNo
namestringNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

deleteParagraphBullets

structure.deleteParagraphBullets Remove bullets from a range of paragraphs Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
startIndexnumberYes
endIndexnumberYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

Tables

deleteTableColumn

tables.deleteTableColumn Delete a column from a table Risk: destructive
Input
NameTypeRequiredDescription
documentIdstringYes
tableCellLocationobjectYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

deleteTableRow

tables.deleteTableRow Delete a row from a table Risk: destructive
Input
NameTypeRequiredDescription
documentIdstringYes
tableCellLocationobjectYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

insertTable

tables.insertTable Insert a table into a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
rowsnumberYes
columnsnumberYes
insertionIndexnumberNo
appendToEndbooleanNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

insertTableColumn

tables.insertTableColumn Insert a column into a table Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
tableCellLocationobjectYes
insertRightbooleanNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

unmergeTableCells

tables.unmergeTableCells Unmerge previously merged table cells Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
tableRangeobjectYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

updateTableRowStyle

tables.updateTableRowStyle Update the style of table rows Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
tableStartLocationobjectYes
rowIndicesnumber[]Yes
tableRowStyleobjectNo
fieldsstringNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

Text

deleteContentRange

text.deleteContentRange Delete a content range from a Google Doc Risk: destructive
Input
NameTypeRequiredDescription
documentIdstringYes
startIndexnumberYes
endIndexnumberYes
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

insertInlineImage

text.insertInlineImage Insert an inline image from a URI into a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
uristringYes
insertionIndexnumberNo
appendToEndbooleanNo
sizeobjectNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

insertPageBreak

text.insertPageBreak Start a new page at a location in a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
insertionIndexnumberNo
appendToEndbooleanNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

insertText

text.insertText Insert text at a location or append to the end of a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
textstringYes
insertionIndexnumberNo
appendToEndbooleanNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

replaceAllText

text.replaceAllText Replace all occurrences of a string in a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
findstringYes
replacestringYes
matchCasebooleanNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo

replaceImage

text.replaceImage Replace an existing image in a Google Doc Risk: write
Input
NameTypeRequiredDescription
documentIdstringYes
imageObjectIdstringYes
uristringYes
imageReplaceMethodCENTER_CROPNo
Output
NameTypeRequiredDescription
documentIdstringNo
repliesobject[]No
writeControlobjectNo