@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Google Sheets API
@base https://sheets.googleapis.com/
@version v4
@auth OAuth2 | OAuth2
@common_fields {spreadsheetId: str}
@endpoints 17
@toc spreadsheets(17)

@endpoint POST /v4/spreadsheets
@optional {dataSourceSchedules: [map{dailySchedule: map, enabled: bool, monthlySchedule: map, nextRun: map, refreshScope: str, weeklySchedule: map}], dataSources: [map{calculatedColumns: [map], dataSourceId: str, sheetId: int(int32), spec: map}], developerMetadata: [map{location: map, metadataId: int(int32), metadataKey: str, metadataValue: str, visibility: str}], namedRanges: [map{name: str, namedRangeId: str, range: map}], properties: map{autoRecalc: str, defaultFormat: map, iterativeCalculationSettings: map, locale: str, spreadsheetTheme: map, timeZone: str, title: str}, sheets: [map{bandedRanges: [map], basicFilter: map, charts: [map], columnGroups: [map], conditionalFormats: [map], data: [map], developerMetadata: [map], filterViews: [map], merges: [map], properties: map, protectedRanges: [map], rowGroups: [map], slicers: [map]}], spreadsheetUrl: str}
@returns(200) {dataSourceSchedules: [map], dataSources: [map], developerMetadata: [map], namedRanges: [map], properties: map{autoRecalc: str, defaultFormat: map{backgroundColor: map{alpha: num(float), blue: num(float), green: num(float), red: num(float)}, backgroundColorStyle: map{rgbColor: map, themeColor: str}, borders: map{bottom: map, left: map, right: map, top: map}, horizontalAlignment: str, hyperlinkDisplayType: str, numberFormat: map{pattern: str, type: str}, padding: map{bottom: int(int32), left: int(int32), right: int(int32), top: int(int32)}, textDirection: str, textFormat: map{bold: bool, fontFamily: str, fontSize: int(int32), foregroundColor: map, foregroundColorStyle: map, italic: bool, link: map, strikethrough: bool, underline: bool}, textRotation: map{angle: int(int32), vertical: bool}, verticalAlignment: str, wrapStrategy: str}, iterativeCalculationSettings: map{convergenceThreshold: num(double), maxIterations: int(int32)}, locale: str, spreadsheetTheme: map{primaryFontFamily: str, themeColors: [map]}, timeZone: str, title: str}, sheets: [map], spreadsheetId: str, spreadsheetUrl: str}

@endpoint GET /v4/spreadsheets/{spreadsheetId}
@optional {includeGridData: bool, ranges: [str]}
@returns(200) {dataSourceSchedules: [map], dataSources: [map], developerMetadata: [map], namedRanges: [map], properties: map{autoRecalc: str, defaultFormat: map{backgroundColor: map{alpha: num(float), blue: num(float), green: num(float), red: num(float)}, backgroundColorStyle: map{rgbColor: map, themeColor: str}, borders: map{bottom: map, left: map, right: map, top: map}, horizontalAlignment: str, hyperlinkDisplayType: str, numberFormat: map{pattern: str, type: str}, padding: map{bottom: int(int32), left: int(int32), right: int(int32), top: int(int32)}, textDirection: str, textFormat: map{bold: bool, fontFamily: str, fontSize: int(int32), foregroundColor: map, foregroundColorStyle: map, italic: bool, link: map, strikethrough: bool, underline: bool}, textRotation: map{angle: int(int32), vertical: bool}, verticalAlignment: str, wrapStrategy: str}, iterativeCalculationSettings: map{convergenceThreshold: num(double), maxIterations: int(int32)}, locale: str, spreadsheetTheme: map{primaryFontFamily: str, themeColors: [map]}, timeZone: str, title: str}, sheets: [map], spreadsheetId: str, spreadsheetUrl: str}

@endpoint GET /v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}
@required {metadataId: int}
@returns(200) {location: map{dimensionRange: map{dimension: str, endIndex: int(int32), sheetId: int(int32), startIndex: int(int32)}, locationType: str, sheetId: int(int32), spreadsheet: bool}, metadataId: int(int32), metadataKey: str, metadataValue: str, visibility: str}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/developerMetadata:search
@optional {dataFilters: [map{a1Range: str, developerMetadataLookup: map, gridRange: map}]}
@returns(200) {matchedDeveloperMetadata: [map]}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo
@required {sheetId: int}
@optional {destinationSpreadsheetId: str}
@returns(200) {dataSourceSheetProperties: map{columns: [map], dataExecutionStatus: map{errorCode: str, errorMessage: str, lastRefreshTime: str(google-datetime), state: str}, dataSourceId: str}, gridProperties: map{columnCount: int(int32), columnGroupControlAfter: bool, frozenColumnCount: int(int32), frozenRowCount: int(int32), hideGridlines: bool, rowCount: int(int32), rowGroupControlAfter: bool}, hidden: bool, index: int(int32), rightToLeft: bool, sheetId: int(int32), sheetType: str, tabColor: map{alpha: num(float), blue: num(float), green: num(float), red: num(float)}, tabColorStyle: map{rgbColor: map{alpha: num(float), blue: num(float), green: num(float), red: num(float)}, themeColor: str}, title: str}

@endpoint GET /v4/spreadsheets/{spreadsheetId}/values/{range}
@required {range: str}
@optional {dateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), majorDimension: str(DIMENSION_UNSPECIFIED/ROWS/COLUMNS), valueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA)}
@returns(200) {majorDimension: str, range: str, values: [[any]]}

@endpoint PUT /v4/spreadsheets/{spreadsheetId}/values/{range}
@required {range: str}
@optional {includeValuesInResponse: bool, responseDateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), responseValueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA), valueInputOption: str(INPUT_VALUE_OPTION_UNSPECIFIED/RAW/USER_ENTERED), majorDimension: str(DIMENSION_UNSPECIFIED/ROWS/COLUMNS), range: str, values: [[any]]}
@returns(200) {spreadsheetId: str, updatedCells: int(int32), updatedColumns: int(int32), updatedData: map{majorDimension: str, range: str, values: [[any]]}, updatedRange: str, updatedRows: int(int32)}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values/{range}:append
@required {range: str}
@optional {includeValuesInResponse: bool, insertDataOption: str(OVERWRITE/INSERT_ROWS), responseDateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), responseValueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA), valueInputOption: str(INPUT_VALUE_OPTION_UNSPECIFIED/RAW/USER_ENTERED), majorDimension: str(DIMENSION_UNSPECIFIED/ROWS/COLUMNS), range: str, values: [[any]]}
@returns(200) {spreadsheetId: str, tableRange: str, updates: map{spreadsheetId: str, updatedCells: int(int32), updatedColumns: int(int32), updatedData: map{majorDimension: str, range: str, values: [[any]]}, updatedRange: str, updatedRows: int(int32)}}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values/{range}:clear
@required {range: str}
@returns(200) {clearedRange: str, spreadsheetId: str}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values:batchClear
@optional {ranges: [str]}
@returns(200) {clearedRanges: [str], spreadsheetId: str}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter
@optional {dataFilters: [map{a1Range: str, developerMetadataLookup: map, gridRange: map}]}
@returns(200) {clearedRanges: [str], spreadsheetId: str}

@endpoint GET /v4/spreadsheets/{spreadsheetId}/values:batchGet
@optional {dateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), majorDimension: str(DIMENSION_UNSPECIFIED/ROWS/COLUMNS), ranges: [str], valueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA)}
@returns(200) {spreadsheetId: str, valueRanges: [map]}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter
@optional {dataFilters: [map{a1Range: str, developerMetadataLookup: map, gridRange: map}], dateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), majorDimension: str(DIMENSION_UNSPECIFIED/ROWS/COLUMNS), valueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA)}
@returns(200) {spreadsheetId: str, valueRanges: [map]}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values:batchUpdate
@optional {data: [map{majorDimension: str, range: str, values: [[any]]}], includeValuesInResponse: bool, responseDateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), responseValueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA), valueInputOption: str(INPUT_VALUE_OPTION_UNSPECIFIED/RAW/USER_ENTERED)}
@returns(200) {responses: [map], spreadsheetId: str, totalUpdatedCells: int(int32), totalUpdatedColumns: int(int32), totalUpdatedRows: int(int32), totalUpdatedSheets: int(int32)}

@endpoint POST /v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter
@optional {data: [map{dataFilter: map, majorDimension: str, values: [[any]]}], includeValuesInResponse: bool, responseDateTimeRenderOption: str(SERIAL_NUMBER/FORMATTED_STRING), responseValueRenderOption: str(FORMATTED_VALUE/UNFORMATTED_VALUE/FORMULA), valueInputOption: str(INPUT_VALUE_OPTION_UNSPECIFIED/RAW/USER_ENTERED)}
@returns(200) {responses: [map], spreadsheetId: str, totalUpdatedCells: int(int32), totalUpdatedColumns: int(int32), totalUpdatedRows: int(int32), totalUpdatedSheets: int(int32)}

@endpoint POST /v4/spreadsheets/{spreadsheetId}:batchUpdate
@optional {includeSpreadsheetInResponse: bool, requests: [map{addBanding: map, addChart: map, addConditionalFormatRule: map, addDataSource: map, addDimensionGroup: map, addFilterView: map, addNamedRange: map, addProtectedRange: map, addSheet: map, addSlicer: map, appendCells: map, appendDimension: map, autoFill: map, autoResizeDimensions: map, clearBasicFilter: map, copyPaste: map, createDeveloperMetadata: map, cutPaste: map, deleteBanding: map, deleteConditionalFormatRule: map, deleteDataSource: map, deleteDeveloperMetadata: map, deleteDimension: map, deleteDimensionGroup: map, deleteDuplicates: map, deleteEmbeddedObject: map, deleteFilterView: map, deleteNamedRange: map, deleteProtectedRange: map, deleteRange: map, deleteSheet: map, duplicateFilterView: map, duplicateSheet: map, findReplace: map, insertDimension: map, insertRange: map, mergeCells: map, moveDimension: map, pasteData: map, randomizeRange: map, refreshDataSource: map, repeatCell: map, setBasicFilter: map, setDataValidation: map, sortRange: map, textToColumns: map, trimWhitespace: map, unmergeCells: map, updateBanding: map, updateBorders: map, updateCells: map, updateChartSpec: map, updateConditionalFormatRule: map, updateDataSource: map, updateDeveloperMetadata: map, updateDimensionGroup: map, updateDimensionProperties: map, updateEmbeddedObjectBorder: map, updateEmbeddedObjectPosition: map, updateFilterView: map, updateNamedRange: map, updateProtectedRange: map, updateSheetProperties: map, updateSlicerSpec: map, updateSpreadsheetProperties: map}], responseIncludeGridData: bool, responseRanges: [str]}
@returns(200) {replies: [map], spreadsheetId: str, updatedSpreadsheet: map{dataSourceSchedules: [map], dataSources: [map], developerMetadata: [map], namedRanges: [map], properties: map{autoRecalc: str, defaultFormat: map{backgroundColor: map, backgroundColorStyle: map, borders: map, horizontalAlignment: str, hyperlinkDisplayType: str, numberFormat: map, padding: map, textDirection: str, textFormat: map, textRotation: map, verticalAlignment: str, wrapStrategy: str}, iterativeCalculationSettings: map{convergenceThreshold: num(double), maxIterations: int(int32)}, locale: str, spreadsheetTheme: map{primaryFontFamily: str, themeColors: [map]}, timeZone: str, title: str}, sheets: [map], spreadsheetId: str, spreadsheetUrl: str}}

@endpoint POST /v4/spreadsheets/{spreadsheetId}:getByDataFilter
@optional {dataFilters: [map{a1Range: str, developerMetadataLookup: map, gridRange: map}], includeGridData: bool}
@returns(200) {dataSourceSchedules: [map], dataSources: [map], developerMetadata: [map], namedRanges: [map], properties: map{autoRecalc: str, defaultFormat: map{backgroundColor: map{alpha: num(float), blue: num(float), green: num(float), red: num(float)}, backgroundColorStyle: map{rgbColor: map, themeColor: str}, borders: map{bottom: map, left: map, right: map, top: map}, horizontalAlignment: str, hyperlinkDisplayType: str, numberFormat: map{pattern: str, type: str}, padding: map{bottom: int(int32), left: int(int32), right: int(int32), top: int(int32)}, textDirection: str, textFormat: map{bold: bool, fontFamily: str, fontSize: int(int32), foregroundColor: map, foregroundColorStyle: map, italic: bool, link: map, strikethrough: bool, underline: bool}, textRotation: map{angle: int(int32), vertical: bool}, verticalAlignment: str, wrapStrategy: str}, iterativeCalculationSettings: map{convergenceThreshold: num(double), maxIterations: int(int32)}, locale: str, spreadsheetTheme: map{primaryFontFamily: str, themeColors: [map]}, timeZone: str, title: str}, sheets: [map], spreadsheetId: str, spreadsheetUrl: str}

@end
