Sheets API
Coming soon: sheets are being tested now. POST /boards/:id/sheets makes a sheet card, blank or from a template, with first cells if you like. GET /boards/:id/cards/:cardId/sheet lists its tabs, GET …/sheet/values reads a range as JSON or CSV with the formulas worked out, and PATCH …/sheet/cells writes up to 5,000 cells, all or nothing. Everything runs as the person the token belongs to, so a private tab, a lock or a cluster you can only view binds a program as it binds you.
Coming soon: Sheets are being tested and will open to everyone shortly.
A sheet card on a cluster holds a spreadsheet. Over the API you make one, read its cells with the formulas worked out, and write cells into it. Everything runs as you: the sheet's own room checks your session, so what the app would refuse you, the API refuses a program too. A sheet counts as one card toward the card cap.
POST /boards/:id/sheets
A new sheet card, placed in free space, at x and y, in a section, or at the top. It needs the write scope.
{
"title": "Budget",
"template": "film",
"currency": "EUR",
"cells": [{ "ref": "B2", "v": 1200 }, { "ref": "B3", "f": "=B2*2" }]
}| Field | |
|---|---|
title | The card's title. Left out, "Untitled sheet"; with a template, the template's own name |
template | film or simple: the sheet is made from that template at once, in the language of the token's account (its Settings language), else English |
currency | An ISO code such as USD or EUR: the template's money cells use it |
tab_name | A blank sheet's first tab: 1 to 100 characters, none of them a control character (anything else is 400 before anything is made). Not with a template, which names its own tabs |
cells | First cells, as in Writing cells. They go in after the template, on its first tab |
x, y, w, h | Where the card goes and how big it is. Left out, it is placed where it covers nothing, at the size the app gives it |
group | The section it goes in, by name |
position | "top" puts it at the top-left, ahead of the sections. Not with group, x or y |
{
"board_id": "9f1c…",
"card": { "id": "api-m2x9k1-a81f3c", "kind": "sheet", "title": "Budget", "face_text": "", … },
"url": "https://clusters.soleilpictures.com/?to=c:9f1c…:api-m2x9k1-a81f3c",
"seeded": true,
"tab": { "id": "a1b2c3", "name": "Budget" },
"cells": { "tab": { "id": "a1b2c3", "name": "Budget" }, "written": 2, "calculated": true, … },
"live": true
}That is a 201. If the first cells were refused after the card was made, the answer is still 201, with cells_refused holding the status, code and error of the refusal instead of cells: write them again with PATCH. If the sheet's room didn't answer, the card and its sheet exist, warnings says so, and the sheet is set up the first time it is opened.
You can make up to 20 sheet cards in one POST /boards/:id/cards call, by sending cards of kind sheet, and 300 new sheets an hour.
curl -X POST https://clusters.soleilpictures.com/api/v1/boards/$BOARD/sheets \
-H "Authorization: Bearer $SOLEIL_TOKEN" -H "Content-Type: application/json" \
-d '{"title":"Budget","template":"film","cells":[{"ref":"B2","v":1200}]}'GET /boards/:id/cards/:cardId/sheet
A sheet's tabs, their sizes, and the locks that bind you.
{
"board_id": "9f1c…", "card_id": "c-3", "url": "…", "seeded": true,
"tabs": [{ "id": "a1b2c3", "name": "Budget", "private": false, "hidden": false,
"readable": true, "color": null, "rows": 100, "cols": 26 }],
"locks": [], "bytes": 48213, "max_bytes": …
}readable is false for a private tab you can't open. color is a tab's colour as stored; nothing in the API writes one. A card that is not a sheet answers 400, naming the route that reads it.
curl https://clusters.soleilpictures.com/api/v1/boards/$BOARD/cards/$CARD/sheet \
-H "Authorization: Bearer $SOLEIL_TOKEN"GET /boards/:id/cards/:cardId/sheet/values
A range of cells, with their formulas worked out.
| Parameter | |
|---|---|
tab | A tab's id or its name. Left out, the first tab |
range | A1 or A1:D20. Left out, the whole used range, up to 50,000 cells; a bigger range is 413 payload_too_large, so read it in parts |
format | json (the default) or csv |
formulas | 1 adds each formula as f |
{
"board_id": "9f1c…", "card_id": "c-3",
"tab": { "id": "a1b2c3", "name": "Budget" }, "calculated": true, "range": "A1:C2",
"rows": [
[{ "v": "Item", "t": "s", "text": "Item" }, null, { "v": 6, "t": "n", "f": "=A2*3", "text": "6" }],
[null, { "v": "a,b", "t": "s", "text": "a,b" }, null]
]
}Each row is a list of cells, an empty cell is null. v is the value, t its type, and text the cell as the sheet shows it. With format=csv the answer is text/csv, each cell as text, and the headers x-sheet-calculated and x-sheet-range say what the JSON would have.
curl "https://clusters.soleilpictures.com/api/v1/boards/$BOARD/cards/$CARD/sheet/values?range=A1:C20&format=csv" \
-H "Authorization: Bearer $SOLEIL_TOKEN"PATCH /boards/:id/cards/:cardId/sheet/cells
Cells written into one tab, all or nothing. It needs the write scope.
{ "tab": "Budget", "cells": [{ "ref": "B2", "v": 1200 }, { "ref": "B3", "f": "=B2*2" }, { "ref": "B4", "v": null }] }{
"board_id": "9f1c…", "card_id": "c-3",
"tab": { "id": "a1b2c3", "name": "Budget" }, "written": 3, "rows_added": 0, "cols_added": 0,
"calculated": true,
"cells": [{ "ref": "B2", "v": 1200, "t": "n", "text": "1,200" }, …]
}curl -X PATCH https://clusters.soleilpictures.com/api/v1/boards/$BOARD/cards/$CARD/sheet/cells \
-H "Authorization: Bearer $SOLEIL_TOKEN" -H "Content-Type: application/json" \
-d '{"cells":[{"ref":"B2","v":1200}]}'Values and what calculated means
The server works a sheet's formulas out only within its bounds: up to 20,000 cells, 120,000 formula characters, and 220 heavy references, where a whole column or row, or a range of 1,000 cells or more, counts 1, and a function that makes an array counts 1 for each 1,000 cells it makes, or 100 when its size isn't given as plain numbers; and only when the sheet's shared tabs, with the one private tab a call opens, are within 4 MB.
A sheet past any of these is not calculated away from the app: calculated: false, formulas come back, their values don't, plain values do. So is a sheet whose last calculation ran out of room or had to be stopped: until someone changes it in the app (on any tab; a change through the API doesn't count). One whose calculation took over 2 seconds is tried again after 6 hours, or sooner if someone changes it in the app. Meanwhile formula writes answer 503 calc_unavailable and values can still be written; the card's face waits for the next person to open it in the app.
A cell whose formula reaches a private tab shows that tab's last result saved in the app, or #N/A, even for a caller who can open that tab, because a call opens only the tab it reads.
Writing cells
cells is a list of { "ref", "v" } or { "ref", "f" }, never both. v is a number, true or false, text, or null to clear the cell; f is a formula starting with =.
- The write is all or nothing: one bad cell, and none of them is written.
- Up to 5,000 cells and 1 MB per call.
- A ref past the end adds rows or columns, within 20,000 rows by 200 columns a tab. The answer says how many in
rows_addedandcols_added. - A cell's text is up to 32,767 characters and a formula 8,192.
- Text with a line break wraps in its cell.
- A formula may name the tab being written and any tab that isn't private. One naming another private tab is
400 bad_formulawithwhy: other_private_tab; the other reasons areunmatched,leftoverandunreadable, andcellsays where. - A row you wrote text into grows to fit the next time someone who can edit the sheet has that tab open, and at once if someone has it open now. Rows that a lock or a private tab keeps that person from changing stay as they are.
Without the write scope, or on a cluster you can only view, a write is 403. A sheet that is at its size limit, 6 MB, only reads: writes answer 402 limit_reached.
When the room doesn't answer
A sheet is read and written through its own live room. When it can't be reached, the answer is 503 room_unavailable. When the error says nothing was written, the call is safe to send again. When it says the write may or may not have landed, read the cells with GET …/sheet/values before sending it again.
The card's face
The sheet's card on the cluster shows the top of one of its tabs. The face, and search, catch up within seconds of a write to a public tab. A private tab never shows on it. face_text on the card, read through the cards API, is the words it shows.
Private tabs and locks
A private tab and a lock bind a token as they bind its person. A private tab you can't open is 403 forbidden, and a lock that covers a cell you write is 403 locked, naming the lock by its lock id. A private tab that, with the sheet's shared tabs, is over 4 MB is 503 tab_too_big, on a read or a write: open it in the app.
A template
template on POST /boards/:id/sheets makes the sheet from a template at once, in the language of the token's account (its Settings language), else English. currency sets its money cells, and cells go in after the template, on its first tab.
Copies
A sheet card that was copied shares nothing with the sheet it came from, and the copy's sheet is made the first time an editor opens it, in the app or through the API (a write, or a read with a token that has the write scope). Until then a read from someone who can't edit the cluster, or with a token without the write scope, is 409 conflict: open it in the app first, or ask someone who can edit the cluster to.
On a GET, a token without the write scope is answered as a viewer is: a copy that no editor has opened yet is a 409, and a sheet card whose sheet doesn't exist yet is a 404. With such a token a read never makes or copies a sheet; with a token that may write, on a cluster you can edit, a read makes or copies it as opening it in the app would.
Deleting and moving
The sheet goes with its card: a deleted sheet card's sheet is kept, and moving the card to another cluster takes the sheet with it. A deleted sheet card comes back from the cluster's Version history in the app, not by POST: sending it back to the cards endpoint is 400 bad_request.
Limits
- 30 calls per 10 seconds per sheet (
429 rate_limited, withretry-after). - 300 new sheets an hour. Going past it is
429 rate_limited, withretry-after. - 20 sheet cards per cards call.
- A read of up to 50,000 cells, a write of up to 5,000.
- A cell's text up to 32,767 characters and a formula 8,192.
- A sheet up to 6 MB: past it the sheet only reads, and writes answer
402 limit_reached. - The calculator's bounds, as above.
A draft (a signed-out MCP session) can't make sheet cards or use these routes. Every refusal's code is on Errors.
Frequently asked questions
Why did I get 503 room_unavailable?
A sheet is read and written through its own live room, and the room couldn't be reached or didn't answer in time. When the error says nothing was written, send the call again. When it says the write may or may not have landed, read the cells with GET …/sheet/values before sending it again.
Why is calculated false?
The server works a sheet's formulas out only within bounds, and only while the sheet's shared tabs and the one private tab a call opens fit in 4 MB. A sheet past any of them comes back with calculated false. Its formulas are still returned with formulas=1, their values aren't, and plain values are. Open the sheet in the app to see everything worked out.
Why didn't my row grow?
A row grows to show its text only when the sheet is open in the app, because only an open page can measure text. A row you wrote text into grows to fit the next time someone who can edit the sheet has that tab open, and at once if someone has it open now. Rows that a lock or a private tab keeps that person from changing stay as they are.
Machine-readable: /docs/api/sheets.md · /llms.txt
What changed and when: /changelog