Preview Batch CSV
Preview the rows in a batch-call CSV before starting the batch.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Request Body
This endpoint accepts multipart/form-data.
filefilerequiredCSV 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.
totalRecordsnumberNumber of data rows in the file.
validRecordsnumberNumber of rows without errors.
previewarrayThe first 5 rows after normalization, each with an internal _hasErrors flag.
recordsarrayThe valid rows only. These are the rows a batch would call.
allRecordsarrayEvery row after normalization, including rows with errors.
validationErrorsarray | nullPer-row problems in the same shape as Validate Batch CSV, or null.
validbooleantrue when no row has an error or warning.
hasWarningsOnlybooleantrue 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