---
title: "Sync To Gsheets"
method: POST
path: "/api/sync/gsheets/{list_id}"
tags: ["Sync"]
---

# Sync To Gsheets

`POST /api/sync/gsheets/{list_id}`

## Request

- Base URL: `https://api.kolens.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolens.ai/api/sync/gsheets/{list_id}`
- Auth: HTTP bearer

Export a KOL list to a new Google Sheet.

Creates a spreadsheet in the service account's Drive, writes all KOL
members as rows with headers, freezes the header row, and optionally
shares the sheet with the caller's email.

Requires ``GOOGLE_SA_JSON`` to be set in the KOLens API environment
(the full JSON contents of a Google service account key file).
The service account must have the Google Sheets API and Google Drive
API enabled in its project.

## Path parameters

- `list_id` string, required

## Request body

- GSheetsSyncBody: Optional body for Google Sheets sync.
  - `title` string, nullable
  - `share_with` string, nullable

## Response `200`

Successful Response

- GSheetsSyncResult
  - `list_id` string, required
  - `list_name` string, required
  - `spreadsheet_url` string, required
  - `spreadsheet_id` string, required
  - `synced` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kolens/apis/kolens-api.md) · [All operations](https://skmtc.dev/kolens/apis/kolens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kolens/apis/kolens-api/revisions/5d6865ab0a24?raw)
