# readSpaceSheet

A spreadsheet's cells (.xlsx, CSV, TSV) by A1 range (any size, any sheet) instead of reading it whole: `range` B2:F40, C7, A:C (whole columns) or 5:9 (whole rows), default every filled cell; `sheet` by name, default the first. Rows come tab-separated, each led by its row number under a line of column letters, a formula as `=SUM(B2:B9) → 1200` (formula, then the value it shows); a range below row 1, or a `find`, shows row 1 first so the columns are named. Up to 12000 characters a page: `nextStartRow` says where to read on. `find` (a few words, case-insensitive) keeps only the rows holding one, with `matchedRows` counting them all. `sheets` lists every sheet's size; `truncated` means the sheet goes on past the 200,000 rows or 500 columns a read reaches. A formula over another sheet shows the value Excel last saved. Pass the result's `versionId` as `baseVersionId` to editSpaceSheetCells.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "readSpaceSheet", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `itemId`: `ID!` (required)
- `versionId`: `ID`
- `sheet`: `String`
- `range`: `String`
- `find`: `[String!]`
- `maxChars`: `Int`

## Response (data, an example)

```json
{
  "spacesQuery": {
    "sheetRange": {
      "versionId": "<ID>",
      "sheets": [
        {
          "name": "…",
          "rowCount": 0,
          "columnCount": 0
        }
      ],
      "sheet": "…",
      "range": "…",
      "rowCount": 0,
      "columnCount": 0,
      "text": "…",
      "matchedRows": 0,
      "nextStartRow": 0,
      "truncated": true
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "readSpaceSheet",
    "variables": {
      "itemId": "<itemId>"
    }
  }'
```
