> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a File's Sheets

> The tabs of a spreadsheet, with their rows and dates, and the sheet selector's answer

[← Files](https://code.dcycle.io/api-reference/files/overview.md)

Read which tabs a workbook has before [opening its import session](https://code.dcycle.io/api-reference/files/import-sessions-v2.md). Only
reads: nothing is scheduled and nothing changes. A CSV has no tabs, so `sheets` is empty.

> [!WARNING]
>
> **Beta.** Part of the Import API, in beta. The contract may still change before general availability.

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.dcycle.io/v2/files/6f1e2d3c-4b5a-4978-8c6d-5e4f3a2b1c0d/sheets?template_id=wastes" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import os

import requests

response = requests.get(
    "https://api.dcycle.io/v2/files/6f1e2d3c-4b5a-4978-8c6d-5e4f3a2b1c0d/sheets",
    params={"template_id": "wastes"},
    headers={"x-api-key": os.environ["DCYCLE_API_KEY"], "x-organization-id": os.environ["DCYCLE_ORG_ID"]},
)
print([sheet["name"] for sheet in response.json()["sheets"]])
```

```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "file_id": "6f1e2d3c-4b5a-4978-8c6d-5e4f3a2b1c0d",
  "sheets": [
    { "name": "Enero", "rows": 412, "date_min": "2026-01-02", "date_max": "2026-01-31" },
    { "name": "Instrucciones", "rows": 8, "date_min": null, "date_max": null }
  ],
  "selection": {
    "state": "decided",
    "template_id": "wastes",
    "main_sheet": "Enero",
    "sheets": ["Enero"],
    "confidence": 0.97,
    "source": "model",
    "reason": null,
    "spec_version": "b3-2026-10-28",
    "updated_at": "2026-11-05T17:20:09Z"
  }
}
```

## Request

### Path Parameters

**file\_id** `string` *required*

The file's id.

### Query Parameters

**template\_id** `string`

The template to read the selector's answer for. Without it, the one the file was classified in.

### Headers

**x-api-key** `string` *required*

Your API key.

**x-organization-id** `string` *required*

The organization that owns the file.

## Response

**sheets** `array`

One entry per tab: `name`, `rows` (non-empty rows under its header) and `date_min` and `date_max` (the first and last
dates of its column with the most dates). All but `name` are null for a tab that was not profiled: past the limit of
tabs or of time, or unreadable.

**selection** `object`

The sheet selector's answer, a suggestion: `state` (`pending`, `decided`, `abstained`, `skipped`, `failed`), `main_sheet`,
`sheets`, `confidence` and `source`. Null when there is none for this file and template: a CSV, an `.xls`, no
template, or the selector not being on for your organization. While `pending`, read it again.

## Errors

Errors are [problem details](https://code.dcycle.io/api-reference/errors.md). `404 NOT_FOUND`, `400 IMPORT_FILE_TYPE_NOT_SUPPORTED` (not a
spreadsheet), `400 IMPORT_FILE_TOO_LARGE`, `422 FILE_NOT_IMPORTABLE`, `503 IMPORT_HEAVY_OPERATION_BUSY`, and `429`
beyond the [rate limits](https://code.dcycle.io/api-reference/rate-limits.md). A workbook's tabs are read once: asking again answers the same
tabs without reading the file again.

## Related Endpoints

> [card] [Open an Import Session](https://code.dcycle.io/api-reference/files/import-sessions-v2.md)
>
> Import the tab you choose

> [card] [Get a File (v2)](https://code.dcycle.io/api-reference/files/get-v2.md)
>
> The file's state


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.