Set Up Bundle Archive Uploads

How archive uploads are validated, extracted, and tracked after adaptive transfer completion.

Bundle archive uploads are intended for large photo sets and other file collections that are easier to transfer as one archive than as many individual files. The transfer itself uses the adaptive bundle upload flow described in Set Up Bundle Uploads.

Flow

  1. Call GET /v1/spatial/bundles/archive-upload-support to read the supported formats and current server limits.
  2. Call POST /v1/spatial/locations/{locationId}/bundles/archive-upload-start.
  3. Transfer the archive using the returned direct upload target or upload session.
  4. Complete the direct upload or session. Completion enqueues extraction in the background-jobs host and returns archiveImportTaskId.
  5. Poll GET /v1/spatial/bundles/archive-imports/{taskId} until the task reaches a terminal state.

After extraction succeeds, the files live in the same bundle layout used by regular per-file bundle uploads. Clients can list bundle metadata, inspect bundle files, request a ZIP download, or start a configured pipeline job for the bundle.

Start a pipeline job after the import

A client that cannot stay online until extraction finishes can ask the server to start the pipeline job itself. Add startPipelineJob to the completion request, either archive-upload-complete or POST /v1/upload-sessions/{sessionId}/complete:

{
  "directUploadId": "11111111-1111-1111-1111-111111111111",
  "completionToken": "server-issued-token",
  "startPipelineJob": {
    "pipeline": "model-build",
    "parameters": { "quality": "high" },
    "idempotencyKey": "9fe7c30d-3134-44ba-b672-1d73d8fdf28c"
  }
}

For a session the body contains only startPipelineJob.

  • pipeline is required. parameters is optional and has the same shape as in Start Pipeline Jobs from Bundles. idempotencyKey is required and follows the Idempotency-Key header rule: 1 to 200 characters after trimming.
  • Leaving the property out, or sending null, keeps completion as it was. The completion response does not change and does not report the job.
  • Only bundle archive completions accept it. Any other upload completion that sends it returns 400 with code request_validation_failed, and so does a missing pipeline or an unusable key.
  • Once the import has reached Succeeded, the server starts the job as the user who uploaded the archive, with a session or a personal access token. All checks of POST /v1/spatial/bundles/{bundleId}/jobs apply at that moment, including job permissions and monthly and lifetime job limits. The job never starts before the import has succeeded.
  • The start is attempted once. If it is denied or fails, the import stays Succeeded and no job exists.
  • Your own POST /v1/spatial/bundles/{bundleId}/jobs remains the fallback and is always safe to send. With the same Idempotency-Key, pipeline and parameters it returns the job the server already started, or starts it if the server did not; it never creates a second job. The same key with a different pipeline or parameters returns 409 with code job_enqueue_idempotency_conflict. startPipelineJob carries no scheduling overrides, so do not add priority, allowCloudBurst or maxRuntimeMinutes to that request unless they equal the started job's values.
  • Repeating a completion that is already finalizing or completed returns the persisted state. It does not enqueue a second import and does not change the stored startPipelineJob.
  • GET /v1/jobs?inputBundleId={bundleId} lists the started job.

Authorization and storage accounting

Archive upload issuance and completion require final LocationBundles=Write. The declared compressed bytes are reserved before the bundle and upload state are created. Completing the transfer enqueues extraction but deliberately leaves that reservation active: the source archive is staging data, and its compressed size is not the durable size of the resulting bundle.

The background finalizer resolves the current requester again. PAT requests must still have a valid token with the required organization and capability ceilings. It then rechecks LocationBundles=Write and Bundle capacity and, in one transaction, attaches the full extracted file set and commits the exact expanded object bytes. Failure before that commit deletes staged objects and releases the reservation. The source archive is deleted after success or terminal failure. Host shutdown cancellation preserves the source archive and storage reservation because the interrupted task is recovered and re-extracted.

Normal imported artifact kinds are classified as Bundle storage. A legacy or mixed bundle can contain a Document-classified artifact; exposing that file or a full bundle ZIP also requires its final path-aware Document read permission. Generated bundle ZIPs are rebuildable, non-billable derived caches and are only exposed after a current authorization check.

Archive sessions use the shared session transfer rules: only the user who created the session can inspect, transfer, complete, or cancel it, current bundle write access is re-checked on every request, and URL refresh stops once the session expires or leaves pending/uploading transfer state.

File completion is idempotent after the archive file reaches uploaded or completed. If a file-complete response is lost, repeat that request to receive the persisted file state without completing the object-storage upload again. Multipart retries also reconcile an exact-size stored object when object storage completed the upload before the API could persist the result. If the session-complete response is lost, repeat session completion. Only one request owns finalization; concurrent or replayed requests return HTTP 200 with session.status and result.status set to finalizing, result.succeeded set to false, and no error while the owner finishes. Poll GET /v1/upload-sessions/{sessionId} until terminal. Entering finalizing extends expiresAtUtc with a bounded server-managed lease, so cleanup skips live work and can reclaim a crashed finalizer after the lease expires. An already completed archive session returns its persisted bundleId without enqueueing extraction again. The winning archive-completion response is currently the only response that carries archiveImportTaskId, so clients must retain that value. A finalizing session cannot be canceled.

Supported formats

The support endpoint is the source of truth, but the current server support includes:

  • .zip
  • .7z
  • .tar
  • .tar.gz
  • .tgz

Encrypted archives are rejected. The importer also rejects symlinks, absolute paths, path traversal attempts, duplicate normalized targets, and archives that exceed configured limits.

stripSingleRootFolder on archive-upload-start is optional. Explicit false preserves all root paths; explicit true strips one shared root folder; omitted uses the configured server default. This choice persists through direct and resumable completion and task recovery. By default the importer strips one shared top-level folder. For example, if every entry is under drone-run-001/, imported bundle files start below that folder instead of keeping it as an extra root directory.

Status behavior

The archive import status response includes:

  • taskId
  • bundleId
  • archiveFileName
  • status
  • progressPercent
  • progressBytes
  • totalBytes
  • statusMessage
  • error

status is one of Queued, Running, Succeeded, Failed, AuthorizationChanged, or CapacityChanged. The last two are stable terminal results from the final policy recheck; error is respectively authorization_changed or capacity_changed.

If extraction, final authorization, or the final capacity commit fails, no new file record becomes visible. Staged objects are quarantined from visibility for bounded cleanup, and the active reservation is released so the bundle does not remain partially populated. Retry by starting a fresh archive upload; the next task publishes its complete file set once or publishes nothing.

Removal

Use DELETE /v1/spatial/bundles/{bundleId} to remove an imported bundle.

This endpoint currently performs an immediate hard delete:

  • The bundle row is removed from the database.
  • Stored bundle file records are removed from the database.
  • The extracted bundle objects are removed from object storage.
  • Uploaded source archive objects under the bundle prefix are removed from object storage.
  • Generated bundle ZIP archives are removed from object storage.

The database mutation is atomic. If another live resource still prevents deletion, the API returns 409 Conflict and leaves both database rows and object-storage data unchanged. Queued, reserved, and running Jobs block deletion; cancel or complete them first. Terminal Job history remains available with references to the deleted bundle or bundle input files cleared.

Object-storage deletion runs after the database commit from a durable BackgroundJobs cleanup record. Cleanup is idempotent and retried after storage failures, so a successful API response can briefly precede physical object removal.

There is no retention window or restore flow yet. Clients should present this as irreversible confirmation before calling the delete endpoint.

Reusing generated bundles

Worker manifests preserve nested paths from the producing job output, for example data/scene_dense.ply and tiles/lod0/model.glb. A follow-up job may use these artifacts in another authorized location in the same organization. Preserve the full relative path when mounting inputs; filenames alone can collide.

On this page