Skip to content
These docs describe Tradr v0.17.0. Running an older release? Check the release notes for what changed.

Validate an uploaded archive and preview what it would restore.

POST
/api/account-data/import/preview
curl --request POST \
--url https://api.tradr.cloud/api/account-data/import/preview \
--header 'Content-Type: application/zip' \
--data binary

Authed. Reads the raw .zip request body, validating it before any write: manifest present and version supported, counts match, every row strict, references resolve, invariants hold and the target account is empty. Writes nothing. Returns the server’s own per-category counts, the source app version, the export date, any degradations and a digest the confirm call must echo. Rate limited with import (10 / hour per user, fallback 6). The server bounds processing to a four-minute limit from handler entry; a longer run times out and previews nothing. Scripts sign in for a session cookie and, on split-origin deployments, send an allowed Origin header.

Media typeapplication/zip
string format: binary

{ counts, sourceAppVersion, exportedAt, degradations, digest }.

ARCHIVE_VERSION_UNSUPPORTED, ARCHIVE_INVALID or ARCHIVE_EMPTY.

No valid session.

IMPORT_TARGET_NOT_EMPTY — the account already holds data; the message names the categories.

ARCHIVE_TOO_LARGE — the upload exceeded a cap; the message names the cap.

IMPORT_TIMED_OUT — processing exceeded the four-minute server limit; nothing was previewed.

Rate limit exceeded (10 / hour per user).

IMPORT_CAPACITY_REACHED — the server is already processing another import; nothing was spooled.