Ingest CSV or JSON spreadsheet rows as draft documents, one per row.
Ingest CSV rows (or JSON spreadsheet rows) as draft documents, one document per row.
Auth: Bearer JWT (WorkOS).
| Param | Type | Required | Notes |
|---|---|---|---|
website_id | uuid | yes | Target website. Note: snake_case here, unlike most endpoints. |
Two content types are accepted, dispatched on the Content-Type header.
multipart/form-data β fields:
schema_name (text, required)file (raw CSV bytes, required). The first row is headers; every cell becomes a trimmed JSON string value.application/json (max 10 MiB):
{
"schema_name": "post",
"spreadsheet_data": [ { "title": "Row 1" }, { "title": "Row 2" } ]
}
schema_name (string, required)spreadsheet_data (array of objects, required){ "inserted": 2 }
Returns 201 Created. Each row becomes a draft document; the document title is the row's first string value.
curl -X POST '{CMS_API_URL}/csv?website_id=<uuid>' \
-H 'Authorization: Bearer <workos-jwt>' \
-H 'Content-Type: application/json' \
-d '{"schema_name":"post","spreadsheet_data":[{"title":"Row 1"}]}'
curl -X POST '{CMS_API_URL}/csv?website_id=<uuid>' \
-H 'Authorization: Bearer <workos-jwt>' \
-F 'schema_name=post' \
-F 'file=@data.csv'
400 β parse errors, missing schema_name/file, non-array spreadsheet_data, non-object rows, or empty CSV401 β missing or invalid JWT500 β insert failure