Logo ExelensiaExelensia/Docs
Getting Started
  • Introduction
API Reference
  • Schemas
  • Templates
  • Upload
  • Process
  • Files
  • Results
  • Exports

Exports

The Exports API generates downloadable CSV files from your extraction results. Export jobs are asynchronous — when you create an export, the API queues the generation and returns immediately. Once complete, use the download endpoint to retrieve a time-limited download URL.

Endpoints

POST /v1/exports

Creates a new export job. The export compiles all extraction results for the specified schema within the given date range into a CSV file.

Request Body

FieldTypeRequiredDescription
schema_idstringYesUUID of the schema whose results to export
start_datestringYesISO 8601 start date — include results created on or after this date
end_datestringYesISO 8601 end date — include results created on or before this date
expand_arraystringNoField key of an array field to expand into multiple rows (one row per array item)
Bash
curl -X POST \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "schema_id": "019760a0-0001-7000-8000-000000000001",
    "start_date": "2024-01-01T00:00:00.000Z",
    "end_date": "2024-01-31T23:59:59.999Z"
  }' \
  "https://api.exelensia.com/v1/exports"

Response

JSON
{
  "id": "019760a0-0050-7000-8000-000000000050",
  "schema_id": "019760a0-0001-7000-8000-000000000001",
  "status": "PENDING",
  "start_date": "2024-01-01T00:00:00.000Z",
  "end_date": "2024-01-31T23:59:59.999Z",
  "expand_array": null,
  "createdAt": "2024-01-31T12:00:00.000Z",
  "updatedAt": "2024-01-31T12:00:00.000Z"
}

Status Codes

StatusDescription
201Export job created
400Invalid request body
401Missing or invalid authentication
404Schema not found

GET /v1/exports

Returns a paginated list of export jobs for your team.

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number (min: 1)
limitnumberNo20Items per page (min: 1, max: 100)
sort_bystringNo—Field to sort by (e.g. createdAt)
sort_orderstringNodescSort direction: asc or desc
searchstringNo—Search filter
created_afterstringNo—ISO 8601 date filter
created_beforestringNo—ISO 8601 date filter
fieldsstringNo—Comma-separated list of fields to return
includestringNo—Related resources to include

Request

Bash
curl -H "x-api-key: your_api_key_here" \
  "https://api.exelensia.com/v1/exports?page=1&limit=20"

Response

JSON
{
  "data": [
    {
      "id": "019760a0-0050-7000-8000-000000000050",
      "schema_id": "019760a0-0001-7000-8000-000000000001",
      "status": "COMPLETED",
      "start_date": "2024-01-01T00:00:00.000Z",
      "end_date": "2024-01-31T23:59:59.999Z",
      "expand_array": null,
      "createdAt": "2024-01-31T12:00:00.000Z",
      "updatedAt": "2024-01-31T12:01:30.000Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 1,
    "totalPages": 1
  }
}

Export Status Values

StatusDescription
PENDINGExport queued, waiting to start
PROCESSINGExport generation in progress
COMPLETEDExport ready for download
FAILEDExport generation failed

Status Codes

StatusDescription
200Success
401Missing or invalid authentication

GET /v1/exports/:id/download

Returns a time-limited download URL for a completed export file.

Path Parameters

ParameterTypeRequiredDescription
idstringYesExport UUID

Request

Bash
curl -H "x-api-key: your_api_key_here" \
  "https://api.exelensia.com/v1/exports/019760a0-0050-7000-8000-000000000050/download"

Response

JSON
{
  "url": "https://exports.exelensia.com/teams/019760a0-0000-7000-8000-000000000000/export_2024_01.csv?token=...&expires=1706961600"
}

Use the returned url to download the CSV file (e.g., with curl -L or via a browser redirect). The URL is valid for a limited time.

Status Codes

StatusDescription
200Download URL returned
401Missing or invalid authentication
404Export not found
409Export is not yet completed

DELETE /v1/exports/:id

Deletes an export job and its associated generated file.

Path Parameters

ParameterTypeRequiredDescription
idstringYesExport UUID

Request

Bash
curl -X DELETE \
  -H "x-api-key: your_api_key_here" \
  "https://api.exelensia.com/v1/exports/019760a0-0050-7000-8000-000000000050"

Response

JSON
{
  "message": "Export deleted successfully"
}

Status Codes

StatusDescription
200Export deleted
401Missing or invalid authentication
404Export not found

On this page

  • Endpoints
  • POST /v1/exports
  • GET /v1/exports
  • GET /v1/exports/:id/download
  • DELETE /v1/exports/:id