---
title: "Initiate a .cube archive import (browser-side multipart upload)"
method: POST
path: "/spaces/{spaceId}/cubes/imports"
tags: ["Imports"]
---

# Initiate a .cube archive import (browser-side multipart upload)

`POST /spaces/{spaceId}/cubes/imports`

## Request

- Base URL: `https://krova.cloud/api/v1`
- URL: `https://krova.cloud/api/v1/spaces/{spaceId}/cubes/imports`
- Auth: API key in header `X-API-KEY`

## Path parameters

- `spaceId` string, required

## Request body

- object
  - `name` string, required
  - `fileSizeBytes` integer, required
  - `sshKeyMode` 'replace' | 'keep': What to do with SSH access on the imported rootfs. `replace` (default) writes `sshPublicKey` to the login user's authorized_keys and requires `sshPublicKey` to be set. `keep` leaves the image's own authorized_keys and sshd configuration completely untouched — nothing is written — so you must already hold a private key that the image accepts, or you will not be able to log in.
  - `sshPublicKey` string, nullable: Public key to install when `sshKeyMode` is `replace`. Written to the login user's `~/.ssh/authorized_keys` — which user that is comes from the imported rootfs itself, so an image without a Krova default user keeps logging in as root. Ignored when `sshKeyMode` is `keep`.
  - `region` string, nullable
  - `vcpusOverride` integer, nullable
  - `ramMbOverride` integer, nullable
  - `diskGbOverride` integer, nullable
  - `userData` string, nullable
  - `expectedConfig` object, nullable
    - `vcpus` integer
    - `ramMb` integer
    - `diskLimitGb` integer

## Response `201`

Import initiated; returns presigned part URLs

- object
  - `importId` string
  - `uploadId` string
  - `key` string
  - `chunkSizeBytes` integer
  - `parts` object[]
    - `partNumber` integer
    - `url` string
  - `expiresAt` string, date-time

## Other responses

- `400`: Invalid input
- `403`: Plan limit exceeded
- `503`: No active storage backend

---

[API](https://skmtc.dev/krova/apis/krova-cloud-api.md) · [All operations](https://skmtc.dev/krova/apis/krova-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/krova/apis/krova-cloud-api/revisions/46bb68281ce1?raw)
