Build with the API

Sheets

Read ranges, apply structured ops, edit with natural language, and review commits.

Creating & reading

curl
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
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
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

Rollback

Restore a prior snapshot as a new commit (itself reversible):