Endpoints
Call these through the okoro proxy at https://okoro.ai/p/google-sheets
| Action | Method | Path | Min scope |
|---|---|---|---|
| Read spreadsheet | GET | read | |
| Create spreadsheet | POST | read | |
| Read cell range | GET | read | |
| Write cell range | PUT | write | |
| Clear cell range | POST | read | |
| Batch read ranges | GET | read | |
| Batch write ranges | POST | read | |
| Batch clear ranges | POST | read | |
| Append values | POST | read | |
| Batch update spreadsheet | POST | read |
Examples
Every request requires a short-lived operation token scoped to a single action.
1. Get an operation token
Exchange your service token for a short-lived operation token scoped to a single action.
TOKEN=$(curl -sX POST "https://okoro.ai/t/tokens" \
-H "Authorization: Bearer $OKORO_SERVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider": "google-sheets", "scope": "read", "intent": "describe what you are doing"}' \
| jq -r '.token')2. Call the API
Use the operation token as a Bearer token. The proxy forwards the request to Google Sheets and logs the action.
Read spreadsheet
curl -X GET "https://okoro.ai/p/google-sheets/spreadsheets/{id}" \
-H "Authorization: Bearer $TOKEN"Create spreadsheet
curl -X POST "https://okoro.ai/p/google-sheets/spreadsheets" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Read cell range
curl -X GET "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values/{id}" \
-H "Authorization: Bearer $TOKEN"Write cell range
curl -X PUT "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values/{id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Clear cell range
curl -X POST "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values/{id}:clear" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Batch read ranges
curl -X GET "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values:batchGet" \
-H "Authorization: Bearer $TOKEN"Batch write ranges
curl -X POST "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values:batchUpdate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Batch clear ranges
curl -X POST "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values:batchClear" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Append values
curl -X POST "https://okoro.ai/p/google-sheets/spreadsheets/{id}/values:append" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Batch update spreadsheet
curl -X POST "https://okoro.ai/p/google-sheets/spreadsheets/{id}:batchUpdate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Scopes
Your service token must be configured with at least the required scope level.
readGET
POST/spreadsheets
/spreadsheets/*
/spreadsheets/*/values/*
/spreadsheets/*/values:batchGetwriteGET
POST
PUT/spreadsheets
/spreadsheets/*
/spreadsheets/*/values/*
/spreadsheets/*/values/*:clear
/spreadsheets/*/values:batchGet
/spreadsheets/*/values:batchUpdate
/spreadsheets/*/values:batchClear
/spreadsheets/*/values:appendupdateGET
POST
PUT
PATCH/spreadsheets
/spreadsheets/*
/spreadsheets/*/values/*
/spreadsheets/*/values/*:clear
/spreadsheets/*/values:batchGet
/spreadsheets/*/values:batchUpdate
/spreadsheets/*/values:batchClear
/spreadsheets/*/values:append
/spreadsheets/*:batchUpdatedeleteGET
POST
PUT
PATCH/spreadsheets
/spreadsheets/*
/spreadsheets/*/values/*
/spreadsheets/*/values/*:clear
/spreadsheets/*/values:batchClear
/spreadsheets/*:batchUpdateallGET
POST
PUT
PATCH
DELETE/**