Sheets
Read ranges, apply structured ops, edit with natural language, and review commits.
Creating & reading
/sheetsList sheets.POST/sheetsCreate a sheet.GET/sheets/{id}Read a sheet's rows.GET/sheets/{id}/rangeRead a range (?sheet=Sheet1&range=A1:D10).curl "https://www.opencharts.com/api/v1/sheets/SHEET_ID/range?sheet=Sheet1&range=A1:D10" \
-H "Authorization: Bearer $OPENCHARTS_API_KEY"Add includeFormulas=true to receive formulas alongside the computed values.
Structured ops
Mutations use the same structured op vocabulary the in-app AI rail applies: set cells and ranges, insert or delete rows and columns, number formats, styling, sorting, filters, and more. Send an array of ops; each is validated and applied or rejected individually:
curl https://www.opencharts.com/api/v1/sheets/SHEET_ID/ops \
-H "Authorization: Bearer $OPENCHARTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ops": [
{ "kind": "set_cell", "sheet": "Sheet1", "cell": "B2", "value": 1250 },
{ "kind": "set_cell", "sheet": "Sheet1", "cell": "B3", "value": "=B2*1.08" }
],
"summary": "Set Q3 revenue + tax formula"
}'Pass "propose": true to stage the change as a reviewable proposal instead of applying immediately.
Natural-language edits
Skip the op vocabulary entirely: describe the change and the sheet AI plans + applies the ops (requires the ai scope):
curl https://www.opencharts.com/api/v1/sheets/SHEET_ID/edit \
-H "Authorization: Bearer $OPENCHARTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "instruction": "Add a totals row and bold the header" }'Commits & review
Every headless change lands as a commit, giving you a git-style trail. Proposals stay pending until merged or rejected:
Rollback
Restore a prior snapshot as a new commit (itself reversible):