---
title: "POST /v4/spreadsheets/{spreadsheetId}/values:batchUpdate"
method: POST
path: "/v4/spreadsheets/{spreadsheetId}/values:batchUpdate"
tags: ["spreadsheets"]
---

# POST /v4/spreadsheets/{spreadsheetId}/values:batchUpdate

`POST /v4/spreadsheets/{spreadsheetId}/values:batchUpdate`

Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.

## Path parameters

- `spreadsheetId` string, required

## Request body

- BatchUpdateValuesRequest — The request for updating more than one range of values in a spreadsheet.
  - `valueInputOption` 'INPUT_VALUE_OPTION_UNSPECIFIED' | 'RAW' | 'USER_ENTERED' — How the input data should be interpreted.
  - `includeValuesInResponse` boolean — Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. The `updatedData` field within each of the BatchUpdateValuesResponse.responses contains the updated values. If the range to write was larger than the range actually written, the response includes all values in the requested range (excluding trailing empty rows and columns).
  - `responseValueRenderOption` 'FORMATTED_VALUE' | 'UNFORMATTED_VALUE' | 'FORMULA' — Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.
  - `data` ValueRange[] — The new values to apply to the spreadsheet.
    - `majorDimension` 'DIMENSION_UNSPECIFIED' | 'ROWS' | 'COLUMNS' — The major dimension of the values. For output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. For input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]` will set `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS` then `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`. When writing, if this field is not set, it defaults to ROWS.
    - `range` string — The range the values cover, in [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell). For output, this range indicates the entire requested range, even though the values will exclude trailing rows and columns. When appending values, this field represents the range to search for a table, after which values will be appended.
    - `values` array[] — The data that was read or to be written. This is an array of arrays, the outer array representing all the data and each inner array representing a major dimension. Each item in the inner array corresponds with one cell. For output, empty trailing rows and columns will not be included. For input, supported value types are: bool, string, and double. Null values will be skipped. To set a cell to an empty value, set the string value to an empty string.
      - unknown[]
        - unknown
  - `responseDateTimeRenderOption` 'SERIAL_NUMBER' | 'FORMATTED_STRING' — Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/sheets.md) · [All operations](https://skmtc.dev/google/apis/sheets/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/sheets/revisions/89de4914a876/schema)
