Trillet AI logo

Preview Batch CSV

Preview the rows in a batch-call CSV before starting the batch.

POSThttps://api.trillet.ai/v1/api/batch-calls/preview

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Request Body

This endpoint accepts multipart/form-data.

filefilerequired

CSV file to preview. Maximum file size: 20MB.

Response

Returns the raw result of the CSV check. It always returns 200 when the file parses, even if rows have errors.

totalRecordsnumber

Number of data rows in the file.

validRecordsnumber

Number of rows without errors.

previewarray

The first 5 rows after normalization, each with an internal _hasErrors flag.

recordsarray

The valid rows only. These are the rows a batch would call.

allRecordsarray

Every row after normalization, including rows with errors.

validationErrorsarray | null

Per-row problems in the same shape as Validate Batch CSV, or null.

validboolean

true when no row has an error or warning.

hasWarningsOnlyboolean

true when every issue is a warning.

Example

curl -X POST "https://api.trillet.ai/v1/api/batch-calls/preview" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID" \
  -F "file=@contacts.csv"

Error Responses

400 with {"error": "..."} when no file is uploaded, the file can't be parsed as CSV, or it has no data rows.

Last updated on