---
title: "Read a CSV or XLSX file: columns, preview, template fields and a suggested mapping"
method: POST
path: "/v1/spreadsheets/parse"
tags: ["Spreadsheets"]
---

# Read a CSV or XLSX file: columns, preview, template fields and a suggested mapping

`POST /v1/spreadsheets/parse`

## Request

- Base URL: `https://api.castpdf.com`
- URL: `https://api.castpdf.com/v1/spreadsheets/parse`
- Auth: HTTP bearer

## Request body

- object
  - `filename` string, required
  - `content_base64` string, required
  - `template_id` string

## Response `200`

OK

- object
  - `format` 'csv' | 'xlsx'
  - `columns` string[]
  - `row_count` integer
  - `max_rows` integer
  - `preview` object[]
  - `fields` string[]
  - `mapping` object

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/castpdf/apis/castpdf-api.md) · [All operations](https://skmtc.dev/castpdf/apis/castpdf-api/llms.txt) · [OpenAPI document](https://skmtc.dev/castpdf/apis/castpdf-api/revisions/4ec737ba2ba6?raw)
