DataTile Knowledge Base
Breadcrumbs

Automated upload via Data Collector API

The Data Collector API loads a data file into DataTile from a script or a scheduled job, without anyone opening the interface. It does the same three things you can do by hand: create a database from a file, reload a database, or append new data to it.

Each upload is one HTTP request. DataTile queues the file, answers with a job ID, and processes the file in the background. You then check the job by its ID, or let DataTile call you back when it is done.

Changed in DataTile 26.11 (November 2026): profile tokens no longer work. The token from the Profile page is retired and existing tokens were not converted. Uploads now need an API key, sent in a different header. If your integration started failing with 401, go to Upgrading an integration that used a profile token.

Before you start

You need

Details

Three roles

Integrator lets you hold API keys.
Data collector enables this API.
Database creator lets you upload data and create databases.
You can see your roles on My profile. A user with the Supervisor role grants them.

Access to the target

To create a database: the right to add items to the target folder.
To reload or append: Edit access to the target database, unless you own it.

An API key

Created under My profile → API keys with the scope Database · Edit. See Managing API keys. The key acts as you: it can never do more than your own roles and permissions allow.

The target's hash

The identifier of the folder or database, taken from its URL. See Hash identifier of an entity in DataTile.

Your server address

The address you open DataTile at, for example https://your-server.datatile.eu. A key works only on the server it was created on.

Authentication

Send your API key in the Authorization header on every request:

Authorization: Bearer dtp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The key is not accepted in the token or X-Auth-Token header, or as a URL parameter.

Upload a file

POST {server}/api/v2/upload/{action}/{hash}

The request body is multipart/form-data with the file in a field named dataset.

Action and target

action

hash is

What happens

create

a folder

A new database is created in that folder. Use the word root in place of a hash to create it outside any folder.

reload

a database

Full reload: the data in the database is replaced by the data in the file.

append

a database

The data in the file is added to the database.

Check the spelling of action. Any value other than create or reload is treated as append, so a mistyped reload appends the file instead of replacing the data.

Supported files

  • SPSS: .sav, .zsav

  • CSV: .csv

  • Excel: .xlsx, .xls

  • Parquet: .parquet

  • A .zip archive containing one of the above. Use only English letters, digits and punctuation in the names of the files inside the archive.

The file name must have an extension; DataTile uses it to recognise the format.

Optional parameters

Send these as extra form fields next to dataset, or in the query string.

Parameter

Meaning

Default

title

Title of the upload, used as the name of a new database.

The file name

charset

Text encoding of the file, for example UTF-8 or windows-1252.

Server setting, normally UTF-8

csvSeparator

Column separator of a CSV file, for example ;.

Server setting, normally a comma

ignoreStrings

true to leave text (string) variables out of the load, false to load them.

Server behaviour

shareTo

Email address of one person to share the resulting database with once the job finishes.

Not shared

shareRole

Access given to shareTo: CanView, CanConfigure, CanShare, CanManage or CanEdit.

CanView

One optional HTTP header:

Header

Meaning

callbackUrl

Address DataTile calls when the job finishes or fails. See Get a callback.

Response

A queued upload answers 202 Accepted with the job ID:

JSON
{
  "id": "2f6c1c0e-8a57-4d0b-9a3e-5b1f0c9d7e21",
  "name": "# 1842"
}

202 means the file was accepted, not that it was loaded. Keep the id and check the job.

Track the job

A job goes through these states:

API3.png

status

Meaning

queued

Waiting for its turn. The queue is checked every 20 seconds or so.

running

The file is being processed.

finished

The data is loaded. url points to the database.

failed

Nothing was loaded. message says why.

Check the status

GET {server}/api/v2/asyncproc/{id}
JSON
{
  "id": "2f6c1c0e-8a57-4d0b-9a3e-5b1f0c9d7e21",
  "name": "# 1842",
  "status": "running",
  "createdAt": "2026-11-20 09:15",
  "modifiedAt": "2026-11-20 09:16"
}

Field

Meaning

status

One of the four states above.

message

Reason of the failure. Present only when the job failed.

url

Address of the resulting database, relative to your server address. Present only when the job finished.

createdAt, modifiedAt

Server time, as yyyy-MM-dd hh:mm on a 12-hour clock without an AM/PM mark. Treat them as information only.

You can see only your own jobs. Polling every 30 seconds is enough. A key with the scope Database · View is sufficient for status calls.

List your recent jobs

GET {server}/api/v2/asyncproc?offset=0&limit=5

Returns your jobs in any state, most recently changed first, as {"list": [ … ]} with the same fields as above. offset defaults to 0 and limit to 5.

Get a callback

If the upload request carried a callbackUrl header, DataTile sends one HTTP POST with a JSON body to that address when the job finishes or fails:

JSON
{
  "status": "EXECUTED",
  "msg": "Execution is completed",
  "link": "https://your-server.datatile.eu/…"
}
JSON
{
  "status": "FAILED",
  "msg": "The loaded file might be corrupted"
}
  • The address must be reachable from your DataTile server.

  • The call carries no credentials and is not repeated if your endpoint is down. Use it as a signal and confirm with a status call when the result matters.

  • There is no callback for queued or running.

See jobs in the interface

All your processing jobs, with their status and the uploaded file, are listed under Processing log in the left menu of the Drive. Old entries are removed automatically.

Examples

Both examples read the key from the DATATILE_API_KEY environment variable, so it never lands in the script.

curl

Bash
SERVER=https://your-server.datatile.eu

# Append a file to a database
curl -X POST "$SERVER/api/v2/upload/append/DATABASE_HASH" \
  -H "Authorization: Bearer $DATATILE_API_KEY" \
  -F "dataset=@wave_12.sav"

# Create a database from a semicolon-separated CSV file
curl -X POST "$SERVER/api/v2/upload/create/FOLDER_HASH" \
  -H "Authorization: Bearer $DATATILE_API_KEY" \
  -F "dataset=@laptops.csv" \
  -F "title=Laptops 2026" \
  -F "csvSeparator=;"

# Check the job
curl "$SERVER/api/v2/asyncproc/JOB_ID" \
  -H "Authorization: Bearer $DATATILE_API_KEY"

Python: upload and wait for the result

Needs requests (pip install requests).

Python
import os
import sys
import time

import requests

SERVER = "https://your-server.datatile.eu"
ACTION = "append"            # create, reload or append
TARGET = "DATABASE_HASH"     # folder hash for create, database hash otherwise
FILE = "wave_12.sav"

session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['DATATILE_API_KEY']}"

# 1. Upload
with open(FILE, "rb") as f:
    response = session.post(
        f"{SERVER}/api/v2/upload/{ACTION}/{TARGET}",
        files={"dataset": f},
    )
if response.status_code != 202:
    sys.exit(f"Upload refused: {response.status_code} {response.text}")
job_id = response.json()["id"]
print(f"Queued as job {job_id}")

# 2. Wait for the job
while True:
    time.sleep(30)
    job = session.get(f"{SERVER}/api/v2/asyncproc/{job_id}").json()
    print(job["status"])
    if job["status"] == "finished":
        print(f"Loaded: {SERVER}{job['url']}")
        break
    if job["status"] == "failed":
        sys.exit(f"Failed: {job.get('message')}")

Upgrading an integration that used a profile token

Before 26.11 a script authenticated with the token from the Profile page, sent in a header named token. That token no longer exists. A script that still sends it, or that sends a new API key in the old token header, gets:

JSON
{
  "available": false,
  "failed": true,
  "result": "KEY_INVALID",
  "status": "UNAUTHORIZED",
  "message": "The API key is invalid. Create a new key on the API keys page."
}

To fix it:

  1. Check on My profile that you have the Integrator role. Users who held Data collector when the server was upgraded received it automatically; otherwise ask a Supervisor.

  2. Create a key under My profile → API keys with the scope Database · Edit, on the server you upload to. If your project moved to a new server, create the key there.

  3. Change the header in your script. Replacing only the value is not enough.

Before

Now

headers={"token": token}

headers={"Authorization": f"Bearer {api_key}"}

-H "token: $TOKEN"

-H "Authorization: Bearer $DATATILE_API_KEY"

Nothing else in the request changes: the address, the dataset field and the parameters are the same. Note that a key expires after 1, 6 or 12 months; DataTile emails you before that, and Managing API keys explains how to replace a key without downtime.

Limits

  • One job per database at a time. A reload or append is refused while an earlier job for the same database is still queued or running.

  • Queue size. The server holds up to 100 waiting jobs across all users and refuses uploads beyond that.

  • File size. Up to 5 GB per request.

  • Throughput. Two jobs are processed at the same time; the rest wait in the queue.

These are the defaults. Your administrator may have set different values on your server.

Errors and troubleshooting

A refused request returns JSON with the reason in message. Authentication errors also carry a code in result.

Status

message

Likely cause

What to do

401

The API key is invalid. Create a new key on the API keys page.

Key sent in the token header; old profile token; key deleted, mistyped, or created on another server.

Send the key as Authorization: Bearer dtp_… to the server it was created on.

401

API key expired

The key's expiry date has passed.

Create a new key.

401

No authentication

No key in the request.

Add the Authorization header.

403

API access disabled

You lack the Integrator role, or your account is not active.

Ask a Supervisor.

403

Insufficient scope

The key does not have Database · Edit.

Create a key with that scope.

403

User has no DATA_COLLECTOR role

You lack the Data collector role.

Ask a Supervisor.

403

User has no DATA_MANAGER role

You lack the Database creator role.

Ask a Supervisor.

403

Access is denied

No permission on the target; for create, the hash is not a folder; for a status call, the job is not yours.

Check the hash and your access to the target.

403

No entity found […]

The hash does not exist on this server, or the database is in the Trash.

Copy the hash again from the database's URL.

403

The destination is busy. Another processing is in progress

An earlier job for the same database has not finished.

Wait for it to finish, then retry.

400

The server processing queue is full

Too many jobs are waiting on the server.

Retry later.

400

No file was provided

The file is not in a form field named dataset.

Name the field dataset.

400

Empty file

The file has no content.

Check the export that produced it.

400

Invalid data file: no extension

The file name has no extension.

Send the file with its extension, for example data.csv.

400

Invalid charset parameter […]

charset is not an encoding the server knows.

Use a standard name such as UTF-8.

400

Invalid shareTo parameter (invalid email address) […]

shareTo is not an email address.

Correct the address.

If the upload was accepted but the job ends as failed, read message in the status response or open the job in the Processing log. Typical reasons are a file that cannot be read, a file whose structure does not match the database it is appended to, or access to the target that was withdrawn after the upload.

API reference

The OpenAPI specification is published at http://api-docs.datatile.eu/. Where it differs from this article on authentication, this article describes the current behaviour.