---
title: "Sanitizes sheet data by removing whitespace padding from string cells in a specified range."
method: POST
path: "/sanitizeSheetData"
---

# Sanitizes sheet data by removing whitespace padding from string cells in a specified range.

`POST /sanitizeSheetData`

This function removes whitespace padding from all string cells within a given range in a Google Sheet and updates the sheet with the cleaned data. It takes an input object containing the range and values to be sanitized, processes the data, and then updates the sheet using the Google Sheets API.

## Request body

- object
  - `body` object — Body of the sanitizeSheetData sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'oauth2' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/google-sheets

## Response `200`

Successfully sanitized and updated the sheet data.

- object — The update result from Google Sheets API.
  - `spreadsheetId` string — The ID of the spreadsheet that was updated.
  - `updatedRange` string — The range that was updated in A1 notation.
  - `updatedRows` integer — The number of rows that were updated.
  - `updatedColumns` integer — The number of columns that were updated.
  - `updatedCells` integer — The number of cells that were updated.

## Other responses

- `400` — Bad request. This could occur if the input parameters are invalid or missing.
- `403` — Forbidden. The request is not authorized to access the sheet.
- `404` — Not found. The specified sheet or range does not exist.
- `500` — Internal server error. An unexpected error occurred while processing the request.

## Changes

- **2025-05-29** `470b95f73df9` — 3 info
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
  - added the optional property `spreadsheetId` to the response with the `200` status
- **2025-05-28** `77260ff78232` — 1 warning, 2 info
  - removed the optional property `spreadsheetId` from the response with the `200` status
  - removed the non-success response with the status `403`
  - removed the non-success response with the status `404`

[Change history](https://skmtc.dev/microfox-ai/apis/google-sheets-sdk-api/changes/sanitizeSheetData/post.md)

---

[API](https://skmtc.dev/microfox-ai/apis/google-sheets-sdk-api.md) · [All operations](https://skmtc.dev/microfox-ai/apis/google-sheets-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/microfox-ai/google-sheets-sdk-api/revisions/85db428f2808/schema)
