---
title: "Convert CSV to JSON"
method: POST
path: "/csv-to-json"
tags: ["Documents"]
---

# Convert CSV to JSON

`POST /csv-to-json`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/csv-to-json`
- Auth: API key in header `x-api-key`

Parses CSV into an array of objects (or arrays with header=false). Real RFC 4180 support: quoted fields can contain commas and newlines.

Costs 1 credit per call.

## Request body

- object
  - `csv` string, required: The CSV text to convert, up to 5 MB. Quoted fields may contain commas and line breaks. All values come back as strings.
  - `header` boolean: true (default) = the first row holds the column names, so each row becomes an object; false = each row becomes an array of values.
  - `delimiter` string: Field separator, exactly one character: "," (default), ";", "|" or a tab. Any other value is ignored and "," is used.
  - `output` 'json' | 'raw': How to return the result: "json" (default: the rows in a "data" field of the JSON response) or "raw" (just the JSON array of rows as the response body).

## Response `200`

Result.

- object
  - `success` boolean
  - `data` unknown[]
    - unknown
  - `meta` object
    - `rows` integer
    - `used` integer: Credits used this month, after this call.
    - `remaining` integer, nullable: Credits left this month (null = unlimited).
    - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

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