Exports

The export endpoint downloads every result for a given schema, within a date range, as a single CSV file. It is part of the Results API and responds synchronously — the CSV is streamed directly in the response body, so there are no export jobs to poll or download URLs to fetch.

The file is UTF-8 encoded with a byte-order mark, so accented characters and currency render correctly in spreadsheet apps such as Excel.

This endpoint is rate limited to 5 requests per minute.

Endpoints

GET /v1/results/export

Streams a CSV of all results for one schema between start_date and end_date.

Query Parameters

ParameterTypeRequiredDescription
schema_idstringYesUUID of the schema whose results to export
start_datestringYesISO 8601 date — include results created on or after this date
end_datestringYesISO 8601 date — include results created on or before this date
expand_arraystringNoKey of an array field in the schema to expand — emits one CSV row per array item instead of one row per result

Request

curl -H "x-api-key: wk_xxxxxxxx.your_secret_here" \
  -o results.csv \
  "https://api.exelensia.com/v1/results/export?schema_id=019760a0-0001-7000-8000-000000000001&start_date=2024-01-01T00:00:00.000Z&end_date=2024-01-31T23:59:59.999Z"

Response

A CSV file is returned directly in the response body:

Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="Invoice-Schema-2024-01-31.csv"

The download filename is derived from the schema name and the current date (<schema-name>-<YYYY-MM-DD>.csv). Columns are derived from the schema's fields; when expand_array is used, the chosen array field is flattened into multiple rows.

Status Codes

StatusDescription
200CSV file returned
400start_date is after end_date (INVALID_DATE_RANGE), or expand_array is not an array field in the schema (INVALID_EXPAND_ARRAY)
401Missing or invalid authentication
403You are not a member of this team
404Schema not found, or no results exist for the schema (NO_RESULTS_FOR_SCHEMA)