Imports & Exports API

Bulk data import and export operations

Imports & Exports API

Upload and download data in bulk using CSV or JSON formats.

Upload Import

POST /api/v1/imports

Request (multipart/form-data):

file: events.csv
type: events
site_id: site_abc123

Response:

{
  "success": true,
  "data": {
    "job_id": "import_abc123",
    "status": "uploading",
    "total_records": 1000
  }
}

Get Import Status

GET /api/v1/imports/{import_id}

Response:

{
  "success": true,
  "data": {
    "job_id": "import_abc123",
    "status": "completed",
    "total_records": 1000,
    "processed_records": 1000,
    "failed_records": 0
  }
}

Create Export

POST /api/v1/exports

Request:

{
  "site_id": "site_abc123",
  "type": "events",
  "name": "monthly_report",
  "format": "csv",
  "scheduled": {
    "frequency": "monthly",
    "next_run": 1703001234567
  }
}

Download Export

GET /api/v1/exports/{export_id}/download

CSV Format

Events CSV:

event_id,site_id,event_type,timestamp_ms,session_id,user_id,url,country
evt_1,site_abc123,page_view,1703001234567,sess_1,user_1,https://example.com,US

Users CSV:

user_id,email,name,company,plan
user_1,john@example.com,John Doe,Acme Corp,premium

Next Steps

Last updated: April 3, 2026