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

Restore a previewed archive into the empty signed-in account.

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

Authed. Re-uploads the raw .zip request body with the preview’s digest in the query; a missing or malformed digest, or one that does not match the uploaded bytes, is refused. Restores whole-or-nothing in one transaction, giving every row a fresh identifier, resolving platform references and overwriting preferences and the dashboard layout (advisor trade-data consent keeps the target’s value). Rate limited with preview (10 / hour per user, fallback 6, shared bucket). The server bounds processing to a four-minute limit from handler entry; a longer run times out before the commit and imports nothing. Scripts sign in for a session cookie and, on split-origin deployments, send an allowed Origin header.

digest
required
string
/^[0-9a-f]{64}$/

The sha256 hex digest the preview returned.

Media typeapplication/zip
string format: binary

ImportResult — the created count per category and the platform-reference resolutions.

ARCHIVE_DIGEST_MISMATCH (missing, malformed or mismatched 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 imported.

Rate limit exceeded (10 / hour per user).

IMPORT_FAILED — the restore rolled back; logged with the request id.

IMPORT_CAPACITY_REACHED (the server is already processing another import; nothing was spooled), IMPORT_BUSY (another data operation held the lock) or OBJECT_UNREACHABLE (an image write failed before any row).