Restore a previewed archive into the empty signed-in account.
const url = 'https://api.tradr.cloud/api/account-data/import?digest=example';const options = {method: 'POST', headers: {'Content-Type': 'application/zip'}, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.tradr.cloud/api/account-data/import?digest=example' \ --header 'Content-Type: application/zip' \ --data binaryAuthed. 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.
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”The sha256 hex digest the preview returned.
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “ Responses ”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).