Upload Endpoint

This page is for loading data from code — CI jobs, ETL pipelines, scripts. To load a file by hand, use the upload actions of the Model Editor; for what to load and how to shape it, read Loading Best Practices.

Loading is two calls against your workspace's address, https://{workspace}.{region}.engeene.com: stage each file for its dataset, then load every staged file of the model at once.

Both calls take an API token as a Bearer token. It needs the data:upload permission to stage a file and model:ingest to start a load. The TypeScript client wraps both calls (upload and triggerIngest).

Stage a file

Method: POST Path: /upload/{model}/{dataset}/{filename} Body: the file itself Authentication: an API token with data:upload on the model

Send each file as the request body, naming the model, the dataset and the file name in the path:

curl -X POST "https://{workspace}.{region}.engeene.com/upload/ecommerce/orders/orders-2025-03.csv" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: text/csv" \
  --data-binary @orders-2025-03.csv
{
  "ok": true,
  "staged": true,
  "filename": "orders-2025-03.csv",
  "bytes": 5242880,
  "message": "File staged. Run ingest to import it."
}

Nothing is loaded yet. Stage every file you have, then start the load once.

Accepted files

File Recognised by
CSV with a header row The default
CSV compressed with gzip or zstd The file's content, not its name
Apache Parquet The file's content
ZIP archive of CSV files A file name ending in .zip

Each file may be at most 32 MiB — split or compress a larger one. Parquet files may use any of the common compressions; decimal, date and timestamp columns are read from the file's own schema, and empty cells stay empty. How each property type reads a value is in Loading Best Practices → How values are read.

Status codes

Status Meaning
200 Staged — start the load next
202 The workspace is not ready for data yet ("queued": true). The file is loaded automatically once it is; there is nothing to start
401 / 403 The token is missing or invalid, or lacks data:upload on this model. A read-only workspace (Demo) refuses every upload
404 The model does not exist
409 The dataset receives its data from a connection (code managed_dataset) — files cannot be uploaded into it
413 The file is larger than 32 MiB (code file_too_large)
503 Your workspace is being moved to another server (code migration_in_progress) — stage the file again after Retry-After seconds

Start the load

Method: POST Path: /data/{model}/ingest Authentication: an API token with model:ingest on the model

curl -X POST "https://{workspace}.{region}.engeene.com/data/ecommerce/ingest" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Engeene answers 202 and loads every staged file of the model in the background. Follow it with GET /data/{model}/ingest-status. Staged files are removed once they are loaded. Starting a load while one is running answers 409 — wait and try again.

Loading modes

The mode query parameter chooses what a load does with the data already there:

Mode Effect
incremental (default) New rows are added to the existing data. Rows with an ID that already exists are updated
replace Every dataset that has newly staged files is replaced by those files. Datasets without new files are not touched
curl -X POST "https://{workspace}.{region}.engeene.com/data/ecommerce/ingest?mode=replace" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

A replace is all-or-nothing: queries see either the old data or the new data, never an empty dataset. Which mode suits which data is in Loading Best Practices.

Status codes

Status Meaning
202 The load started in the background
409 A load is already running, or the model is unknown — wait and try again
503 Your workspace is being moved; the load runs once the move completes

Desktop app

The desktop app in Analytics mode accepts files at POST /model-editor/{model}/upload/{dataset}/{filename} on its local address, up to 100 MiB each by default, and loads them with the same POST /data/{model}/ingest.

Next: Query Endpoint.

← Models EndpointQuery Endpoint →