Archive API: importing legacy data without a browser

The API under /api/v1/archive: upload PST, MBOX, EML and ZIP files by script, check the count, approve the import one by one or in bulk and query the status. PST up to 250 GB per file.

Large legacy holdings can also reach the archive without a browser. The API under /api/v1/archive performs the same steps as the Legacy data tab under Archive, Sources:

  1. Create a job.
  2. Upload the file.
  3. Check the count.
  4. Approve the import.

A script can thus upload many files overnight or from a server, without a browser window staying open. Which way suits which case is described under importing legacy data.

Address and sign-in

Addresshttps://conbool.com/api/v1/archive, for your own installation its address
Sign-inheader Authorization: Bearer <key>
Scopearchive:import
Limit60 calls per key and minute, shared by all calls of this key under /api/v1
Lockoutafter 30 failed sign-ins within one minute from the same address, the API answers that address with 429

Key

A key is created under Administration, Settings, tile SIEM and APIs:

  • Usually in the Connections tab, sub-tab Endpoint, card API keys.
  • Depending on the products booked, the tab is called Keys and shows the API keys card directly.

There, choose Create new API key and turn on the Archive import switch. Only someone who may manage API keys can create a key. The switch only exists in a tenant with Archive, and only someone who may manage the archive settings can set it. The card under 365 Backup only creates keys for the backup; the switch is missing there.

A key can be restricted to IP addresses, given an expiry and revoked. For a script, it is advisable to restrict the key to the addresses of the server it runs on and to give it an expiry.

The key acts on behalf of the person who created it:

  • Their jobs appear in the Legacy data tab like any other job.
  • The log records the API and the key's identifier.
  • If the person loses the right to the archive settings or leaves the tenant, the API no longer accepts the key.

The scope allows importing only. Reading or searching the archive is not part of it.

Flow

1. Choose the target mailbox

GET /api/v1/archive/mailboxes

The response lists the mailboxes of the directory, whether they already hold an archive seat, and how many seats are free:

{
  "mailboxes": [
    { "email": "anna@example.org", "name": "Anna Example", "hasArchiveSeat": true }
  ],
  "freeSeats": 12
}

All messages of a file land in exactly one mailbox. For several mailboxes there is therefore one file and one job per mailbox.

2. Create a job

POST /api/v1/archive/imports

{
  "mailbox": "anna@example.org",
  "fileName": "anna-2019-2024.pst",
  "sizeBytes": 193273528320
}

format (pst, mbox, eml or zip) is optional; without it the file extension applies. The response with status 201 contains the job and the upload plan:

{
  "import": { "id": "…", "phase": "uploading", "…": "…" },
  "upload": { "partSize": 268435456, "partCount": 720, "partUrlTtlSeconds": 3600 }
}

3. Upload

The file is cut into partCount parts of size partSize; the last part is shorter. Part 1 starts at byte 0.

  1. Fetch addresses for up to 100 parts: POST /api/v1/archive/imports/{id}/parts with { "partNumbers": [1, 2, 3] }.
  2. Send each part with PUT to its address.

The response lists the address and its expiry for each part:

{
  "parts": [
    { "partNumber": 1, "url": "https://…", "expiresAt": "2026-12-02T10:14:03.512Z" }
  ]
}

The addresses are valid for one hour. So only fetch as many as will be uploaded in that time. Anyone who knows an address can write the part during that time, so the addresses do not belong in logs, tickets or chats.

The file goes straight into the archive's storage, not through a Conbool server. Parts can be sent in parallel.

Resuming after an interruption: GET /api/v1/archive/imports/{id}/parts lists in uploadedPartNumbers the parts that have already arrived. Upload only the missing ones.

If nothing happens on an upload for 24 hours, it counts as abandoned and is cancelled. Every call to …/parts counts as a sign of life.

4. Complete

POST /api/v1/archive/imports/{id}/complete with { "sizeBytes": 193273528320 }

The list of parts comes from the storage, not from the caller, so the script does not need to keep the check value (ETag) the storage returns for each part. If parts are missing, the API answers with 409 archive.upload_incomplete, and uploading can continue. A second call after completion changes nothing.

5. Check the count and approve

After completion, the import counts the messages in the file. Nothing goes into the archive yet. GET /api/v1/archive/imports/{id} shows the status:

  • phase is counting during the count and awaiting_approval afterwards.
  • counts.discovered gives the number of messages.

Only then does it continue:

POST /api/v1/archive/imports/{id}/approve

Without approval nothing is archived, and no setting skips it. The reason: anything in the archive is subject to retention and cannot be taken back. An import into the wrong mailbox would stay there until the period ends.

Approval is also possible in the Legacy data tab.

6. Approving several imports in bulk

Whoever uploads many files approves them together in two steps.

GET /api/v1/archive/imports/approval gives how many counted imports are waiting, how many messages they hold together, and a cut-off time:

{
  "awaitingApproval": { "count": 12, "discovered": 845210, "countedUpTo": "2026-12-02T09:14:03.512+00:00" }
}

If nothing is waiting, count is 0 and countedUpTo is null.

POST /api/v1/archive/imports/approval with { "countedUpTo": "…" }, the value from the GET, unchanged. All imports whose count had finished by that time are approved. Anything counted afterwards is left out; there is no approval for future imports. The response gives approved, discovered and importIds. Each approval is logged separately.

7. Tracking

GET /api/v1/archive/imports lists the latest 100 jobs. GET /api/v1/archive/imports/{id} shows one.

The counters in counts:

CounterMeaning
discoveredmessages according to the count
importedtaken into the archive
duplicatesalready in the archive with the same content
failednot imported
skippedNonMailPST only: appointments, tasks and contacts, not an error

A job can be cancelled as long as it has not finished: POST /api/v1/archive/imports/{id}/cancel. Whatever has been archived until then stays in the archive.

States

phaseMeaning
uploadingfile is being uploaded
queueduploaded, waiting for the import
countingcount running, nothing in the archive yet
awaiting_approvalcount finished, waiting for approval
importingapproved, messages are being archived
pausedpaused, by hand or because storage is short
completedfinished
failedfailed, reason in lastError
cancelledcancelled

Limits

FormatLargest file
PST250 GB
MBOX, EML, ZIP60 GB
all formats, operated on premises60 GB

Further limits:

  • A ZIP holds single EML files, at most 200,000 entries.
  • One call signs at most 100 parts.
  • A single message in an MBOX, EML or ZIP file may be at most 150 MiB. The import does not take larger ones; they count under failed.
  • A mailbox without an archive seat needs a free seat. If all are taken, the API answers with 409 archive.no_free_seat.

A larger holding can be split into several files, for example by year. Each file is then its own job for the same mailbox. Messages already in the archive with the same content count as duplicates and are not stored twice.

Errors

Every error response has the form { "error": { "code": "…", "message": "…" } }. For sign-in errors and for status 500, message is missing.

StatusMeaning
400invalid input (archive.invalid_input), unknown format (archive.unknown_format)
401key missing, invalid, revoked, expired, still awaiting approval or not allowed for this IP address
403scope missing, the key owner may not manage the archive settings, or the tenant has no Archive
404job unknown
409step does not fit the state, such as upload incomplete, size mismatch, count not finished, job already finished, no free archive seat
413file larger than allowed (archive.file_too_large)
422mailbox unknown in the directory (archive.unknown_mailbox)
429too many calls, retry after the time in the Retry-After header
500unexpected error (archive.internal_error), try again later
503approval not possible right now (archive.approval_unavailable), try again later

OpenAPI description

A machine-readable description in OpenAPI 3 format is available at /assets/archive-import-openapi.json.