# VM: Snapshot imports **Page:** api/vm/imports [Download Raw Markdown](./api/vm/imports.md) --- # VM: Snapshot imports Use these endpoints to upload an exported snapshot artifact into a computer's VM import store, verify its SHA-256 digest, publish it, and create one or more VMs from the published artifact. The import store retains artifacts until you delete them. ## Import workflow 1. **Declare the artifact.** Begin or resume an upload with the artifact's total size in bytes. The import store identifies each artifact by its 64-character lowercase hexadecimal SHA-256 digest. 2. **Upload every part in order.** Use the `part_size` returned by the service. Every part except the last must contain exactly `part_size` bytes. The service uses 8 MiB, so examples show `part_size` as `8388608`, but clients must always use the returned value. 3. **Verify and publish.** Finalize the upload after all bytes have been sent. The service hashes the uploaded bytes and publishes the artifact only when the digest matches. Only an artifact with `phase: ready` can be used to create a VM. 4. **Create the VM with the required settings.** Use a `snapshot-artifact` source that names the artifact's `sha256`. The source holds only `type`, `sha256`, and `duplicate_tpm_identity`. The `memory_mib`, `vcpus`, and `bus` fields are top-level create fields beside `source`, and all three are required, because the artifact records none of them. Omitting `bus` is refused with 400. `bus` must be the bus the guest was installed on, because selecting a different bus leaves a guest that cannot boot. 5. **Handle TPM state.** An artifact that carries TPM state, including every Windows 11 guest, also requires `duplicate_tpm_identity: true` in the source. Otherwise, the create is refused with 400. This setting gives the new VM the same TPM identity and sealed keys as the original. 6. **Manage retained artifacts.** A published artifact remains after a VM is created from it and can build more VMs. It occupies storage until deleted. Deletion is irreversible and does not affect VMs already created from the artifact. A snapshot artifact does not contain the VM's memory size, vCPU count, or bus configuration. Confirm these values against the original guest before creating a VM. For artifacts with TPM state, confirm that duplicating the TPM identity is intended before setting `duplicate_tpm_identity: true`. ## List snapshot artifacts `GET /api/v1/vm/imports` Returns all artifacts in the import store, including published artifacts and uploads still in progress. An unfinished upload remains in the store and is never removed automatically. A published artifact remains after a VM is created from it, so it can build more VMs and continues to occupy storage until deletion. This endpoint takes no parameters. ### Examples ```bash curl --globoff --request GET \ "https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com/api/v1/vm/imports" ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com' }); const artifacts = await client.vm.imports.list(); ``` ### Response fields Each item in the response array describes one artifact. | Field | Type | Required | Description | |---|---|---|---| | `sha256` | `string` | Yes | The artifact's lowercase hexadecimal SHA-256 digest and identity. | | `phase` | `string` | Yes | `uploading` while parts are still being sent, or `ready` after the bytes are verified. | | `bytes` | `integer` | Yes | Bytes durably stored. This is the resume point while uploading and the final size when ready. | | `part_size` | `integer` | Yes | The exact size that every part except the last must contain. | | `next_part` | `integer` | No | The zero-based part index to send next. It is absent on a ready artifact. | | `modified_unix` | `integer` | Yes | Last modification time in seconds since the Unix epoch. | Error responses contain these fields: | Field | Type | Required | Description | |---|---|---|---| | `error` | `object` | Yes | Error details. | | `error.code` | `string` | Yes | A fixed error code. Branch on this value rather than `error.message`. | | `error.message` | `string` | Yes | Human-readable error information. | | `error.retryable` | `boolean` | Yes | Whether repeating the identical request could succeed without any other change. | ### Responses Media type: application/json ```json [ { "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "phase": "uploading", "bytes": 8388608, "part_size": 8388608, "next_part": 1, "modified_unix": 1767225600 }, { "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "phase": "ready", "bytes": 12582912, "part_size": 8388608, "modified_unix": 1767225601 } ] ``` Media type: application/json ```json { "error": { "code": "SpecInvalid", "message": "Query parameters are not accepted by this endpoint.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `SpecInvalid` | Invalid request specification | The endpoint accepts no query parameters, so a request containing any is refused. | Remove all query parameters and repeat the request. | Media type: application/json ```json { "error": { "code": "StorageFailed", "message": "The import store could not complete the storage operation.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `StorageFailed` | Storage operation failed | The import store could not complete the requested storage operation. | Inspect `error.retryable` and retry when an unchanged request can succeed. | ## Get a snapshot artifact `GET /api/v1/vm/imports/{sha256}` Returns an artifact's publication status. For an unfinished upload, it also reports the number of bytes stored and the part to send next. These values are read from the stored data, so they remain accurate after a crash on either side. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `sha256` | `path` | `string` | Yes | The artifact's SHA-256 digest, exactly 64 lowercase hexadecimal characters. | This endpoint takes no request body. ### Examples ```bash curl --globoff --request GET \ "https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com/api/v1/vm/imports/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com' }); const sha256 = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'; const artifact = await client.vm.imports.get(sha256); ``` ### Response fields | Field | Type | Required | Description | |---|---|---|---| | `sha256` | `string` | Yes | The artifact's lowercase hexadecimal SHA-256 digest and identity. | | `phase` | `string` | Yes | `uploading` while parts are still being sent, or `ready` after verification. | | `bytes` | `integer` | Yes | Bytes durably stored. This is the resume point while uploading and the final size when ready. | | `part_size` | `integer` | Yes | The exact size that every part except the last must contain. | | `next_part` | `integer` | No | The zero-based part index to send next. It is absent on a ready artifact. | | `modified_unix` | `integer` | Yes | Last modification time in seconds since the Unix epoch. | Error responses contain these fields: | Field | Type | Required | Description | |---|---|---|---| | `error` | `object` | Yes | Error details. | | `error.code` | `string` | Yes | A fixed error code. Branch on this value rather than `error.message`. | | `error.message` | `string` | Yes | Human-readable error information. | | `error.retryable` | `boolean` | Yes | Whether repeating the identical request could succeed without any other change. | ### Responses Media type: application/json ```json { "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "phase": "uploading", "bytes": 8388608, "part_size": 8388608, "next_part": 1, "modified_unix": 1767225600 } ``` Media type: application/json ```json { "error": { "code": "NameInvalid", "message": "The sha256 value must contain exactly 64 lowercase hexadecimal characters.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NameInvalid` | Invalid SHA-256 digest | The `sha256` path value is not exactly 64 lowercase hexadecimal characters. | Replace it with the artifact's 64-character lowercase hexadecimal digest. | | `SpecInvalid` | Invalid request specification | The endpoint accepts no query parameters, so a request containing any is refused. | Remove all query parameters and repeat the request. | Media type: application/json ```json { "error": { "code": "NotFound", "message": "No artifact or upload matches the requested digest.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NotFound` | Artifact not found | No published artifact or upload has the requested digest. | Verify the digest or begin an upload for that artifact. | Media type: application/json ```json { "error": { "code": "StorageFailed", "message": "The import store could not complete the storage operation.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `StorageFailed` | Storage operation failed | The import store could not complete the requested storage operation. | Inspect `error.retryable` and retry when an unchanged request can succeed. | ## Begin or resume a snapshot artifact upload `POST /api/v1/vm/imports/{sha256}` Declares an artifact upload under its SHA-256 digest and total size. If the artifact is already published, the response has `phase: ready` and no upload is needed. If an earlier upload was interrupted, the response identifies the next part to resume from. This operation is safe to repeat and never truncates an upload in progress. On a resume, a different `bytes` value replaces the declared total when it is at least the number of bytes already stored. The resume point is then recalculated, allowing a mis-declared upload to be corrected. Plan for twice the artifact's size because the retained artifact and the VM rebuilt from it exist at the same time. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `sha256` | `path` | `string` | Yes | The artifact's SHA-256 digest, exactly 64 lowercase hexadecimal characters. | ### Request body | Field | Type | Required | Description | |---|---|---|---| | `bytes` | `integer` | Yes | The artifact's total size in bytes. It must be positive and cannot be less than the bytes already stored. | Declaring `bytes` does not reserve storage. It allows the service to return 507 immediately if the artifact cannot fit. On a resume, a larger valid total replaces the previous declaration and recalculates `next_part`. ### Examples ```bash curl --globoff --request POST \ "https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com/api/v1/vm/imports/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" \ --header "Content-Type: application/json" \ --data '{"bytes": 12582912}' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com' }); const sha256 = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'; const data = { bytes: 12582912 }; const artifact = await client.vm.imports.create(sha256, data); ``` ### Response fields | Field | Type | Required | Description | |---|---|---|---| | `sha256` | `string` | Yes | The artifact's lowercase hexadecimal SHA-256 digest and identity. | | `phase` | `string` | Yes | `uploading` while parts are still being sent, or `ready` after verification. | | `bytes` | `integer` | Yes | Bytes durably stored. This is the resume point while uploading and the final size when ready. | | `part_size` | `integer` | Yes | The exact size that every part except the last must contain. | | `next_part` | `integer` | No | The zero-based part index to send next. It is absent on a ready artifact. | | `modified_unix` | `integer` | Yes | Last modification time in seconds since the Unix epoch. | Error responses contain these fields: | Field | Type | Required | Description | |---|---|---|---| | `error` | `object` | Yes | Error details. | | `error.code` | `string` | Yes | A fixed error code. Branch on this value rather than `error.message`. | | `error.message` | `string` | Yes | Human-readable error information. | | `error.retryable` | `boolean` | Yes | Whether repeating the identical request could succeed without any other change. | ### Responses Media type: application/json ```json { "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "phase": "uploading", "bytes": 8388608, "part_size": 8388608, "next_part": 1, "modified_unix": 1767225600 } ``` Media type: application/json ```json { "error": { "code": "SpecInvalid", "message": "The declared total must be positive and cannot be less than the bytes already stored.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NameInvalid` | Invalid SHA-256 digest | The `sha256` path value is not exactly 64 lowercase hexadecimal characters. | Replace it with the artifact's 64-character lowercase hexadecimal digest. | | `SpecInvalid` | Invalid request specification | `bytes` is zero, or a resumed declaration is less than the number of bytes already stored. The endpoint also refuses requests that contain query parameters. | Send a positive total that is not less than the stored byte count, and remove all query parameters. | Media type: application/json ```json { "error": { "code": "RequestBodyStalled", "message": "The request body stopped before it was fully received.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `RequestBodyStalled` | Request body stalled | The request body stopped arriving. | Retry the request with the complete body. | Media type: application/json ```json { "error": { "code": "OperationInProgress", "message": "Another operation is already using this digest.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `OperationInProgress` | Operation already in progress | Another call is working on the same digest. | Retry shortly. | Media type: application/json ```json { "error": { "code": "StorageFailed", "message": "The import store could not complete the storage operation.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `StorageFailed` | Storage operation failed | The import store could not complete the requested storage operation. | Inspect `error.retryable` and retry when an unchanged request can succeed. | Media type: application/json ```json { "error": { "code": "InsufficientSpace", "message": "There is not enough storage for the declared artifact.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `InsufficientSpace` | Insufficient storage | The declared artifact size does not fit. On a resume, the remaining bytes do not fit. | Free enough storage for the declared artifact, then repeat the request. | ## Upload one part of a snapshot artifact `PUT /api/v1/vm/imports/{sha256}/parts/{part}` Appends one part of an artifact. Parts must be sent in order. Part `n` is accepted only when exactly `n*part_size` bytes are stored. Every part except the last must contain exactly `part_size` bytes. A replayed part is refused rather than applied twice, so a request whose response was not observed can be retried safely. When the stored `bytes` reach the declared total, call **Verify and publish a snapshot artifact**. If an upload is interrupted during a part, `bytes` reports the last complete part boundary and `next_part` identifies the part to send again. After any failure, call **Get a snapshot artifact** to determine where to resume. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `sha256` | `path` | `string` | Yes | The artifact's SHA-256 digest, exactly 64 lowercase hexadecimal characters. | | `part` | `path` | `integer` | Yes | Zero-based part index. Part `n` covers bytes `[n*part_size, (n+1)*part_size)`. | ### Request body Send the raw part as `application/octet-stream`. The request has no JSON body fields. Use the `part_size` returned by the service. Every part except the final part must contain exactly that many bytes. ### Examples ```bash curl --globoff --request PUT \ "https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com/api/v1/vm/imports/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08/parts/0" \ --header "Content-Type: application/octet-stream" \ --data-binary @snapshot.part ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com' }); const { readFile } = await import('node:fs/promises'); const sha256 = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'; const part = 0; const data = new Uint8Array(await readFile('snapshot.part')); const artifact = await client.vm.imports.uploadPart(sha256, part, data); ``` ### Response fields | Field | Type | Required | Description | |---|---|---|---| | `sha256` | `string` | Yes | The artifact's lowercase hexadecimal SHA-256 digest and identity. | | `phase` | `string` | Yes | `uploading` while parts are still being sent, or `ready` after verification. | | `bytes` | `integer` | Yes | Bytes durably stored. This is the resume point while uploading and the final size when ready. | | `part_size` | `integer` | Yes | The exact size that every part except the last must contain. | | `next_part` | `integer` | No | The zero-based part index to send next. It is absent on a ready artifact. | | `modified_unix` | `integer` | Yes | Last modification time in seconds since the Unix epoch. | Error responses contain these fields: | Field | Type | Required | Description | |---|---|---|---| | `error` | `object` | Yes | Error details. | | `error.code` | `string` | Yes | A fixed error code. Branch on this value rather than `error.message`. | | `error.message` | `string` | Yes | Human-readable error information. | | `error.retryable` | `boolean` | Yes | Whether repeating the identical request could succeed without any other change. | ### Responses Media type: application/json ```json { "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "phase": "uploading", "bytes": 8388608, "part_size": 8388608, "next_part": 1, "modified_unix": 1767225600 } ``` Media type: application/json ```json { "error": { "code": "SpecInvalid", "message": "The part index and body size do not satisfy the upload rules.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NameInvalid` | Invalid SHA-256 digest | The `sha256` path value is not exactly 64 lowercase hexadecimal characters. | Replace it with the artifact's 64-character lowercase hexadecimal digest. | | `SpecInvalid` | Invalid request specification | The part is empty or larger than `part_size`, or the part index is not a non-negative integer. The endpoint also refuses requests that contain query parameters. | Use a non-negative part index, send no more than `part_size` bytes, and remove all query parameters. | Media type: application/json ```json { "error": { "code": "NotFound", "message": "No upload is active for the requested digest.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NotFound` | Upload not found | No upload is in progress for the requested digest. | Call **Begin or resume a snapshot artifact upload** first. | Media type: application/json ```json { "error": { "code": "RequestBodyStalled", "message": "The part body stopped before it was fully received.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `RequestBodyStalled` | Request body stalled | The request body stopped arriving, and nothing was stored. | Send the same part again. | Media type: application/json ```json { "error": { "code": "BadState", "message": "The requested part does not match the next expected part.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `BadState` | Incorrect upload part | The requested part does not match the part required by the stored length. | Read `next_part` and send that part. | | `AlreadyExists` | Artifact already published | The artifact is already published. | Use the published artifact without uploading another part. | | `OperationInProgress` | Operation already in progress | Another call is working on the same digest. | Retry shortly. | Media type: application/json ```json { "error": { "code": "StorageFailed", "message": "The import store could not complete the storage operation.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `StorageFailed` | Storage operation failed | The import store could not complete the requested storage operation. | Inspect `error.retryable` and retry when an unchanged request can succeed. | Media type: application/json ```json { "error": { "code": "InsufficientSpace", "message": "There is not enough storage to retain this part.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `InsufficientSpace` | Insufficient storage | There is not enough storage for the part. | Free enough storage and retry the part. | ## Verify and publish a snapshot artifact `POST /api/v1/vm/imports/{sha256}/finalize` Hashes every uploaded byte and publishes the artifact when the result matches its SHA-256 digest. Only a published artifact can be used to create a VM. Verification takes a few seconds per gigabyte. A digest mismatch is refused with 400, and the upload is retained. A mismatch often means that parts are missing. Compare `bytes` with the real artifact size, send any missing parts, and call this operation again. The operation is idempotent after the artifact is published. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `sha256` | `path` | `string` | Yes | The artifact's SHA-256 digest, exactly 64 lowercase hexadecimal characters. | This endpoint takes no request body. ### Examples ```bash curl --globoff --request POST \ "https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com/api/v1/vm/imports/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08/finalize" ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com' }); const sha256 = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'; const artifact = await client.vm.imports.finalize(sha256); ``` ### Response fields | Field | Type | Required | Description | |---|---|---|---| | `sha256` | `string` | Yes | The artifact's lowercase hexadecimal SHA-256 digest and identity. | | `phase` | `string` | Yes | `uploading` while parts are still being sent, or `ready` after verification. | | `bytes` | `integer` | Yes | Bytes durably stored. This is the resume point while uploading and the final size when ready. | | `part_size` | `integer` | Yes | The exact size that every part except the last must contain. | | `next_part` | `integer` | No | The zero-based part index to send next. It is absent on a ready artifact. | | `modified_unix` | `integer` | Yes | Last modification time in seconds since the Unix epoch. | Error responses contain these fields: | Field | Type | Required | Description | |---|---|---|---| | `error` | `object` | Yes | Error details. | | `error.code` | `string` | Yes | A fixed error code. Branch on this value rather than `error.message`. | | `error.message` | `string` | Yes | Human-readable error information. | | `error.retryable` | `boolean` | Yes | Whether repeating the identical request could succeed without any other change. | ### Responses Media type: application/json ```json { "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "phase": "ready", "bytes": 12582912, "part_size": 8388608, "modified_unix": 1767225600 } ``` Media type: application/json ```json { "error": { "code": "SpecInvalid", "message": "The uploaded bytes do not yet match the declared digest.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NameInvalid` | Invalid SHA-256 digest | The `sha256` path value is not exactly 64 lowercase hexadecimal characters. | Replace it with the artifact's 64-character lowercase hexadecimal digest. | | `SpecInvalid` | Invalid request specification | The uploaded bytes hash to a different digest, or no bytes have been uploaded. The upload is retained. The endpoint also refuses requests that contain query parameters. | Compare `bytes` with the real artifact size, upload missing parts, remove all query parameters, and finalize again. If the size already matches, verify the source artifact. | Media type: application/json ```json { "error": { "code": "NotFound", "message": "There is no upload or published artifact for this digest.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NotFound` | Upload or artifact not found | No upload is in progress for the digest, and no artifact is published under it. | Call **Begin or resume a snapshot artifact upload** first. | Media type: application/json ```json { "error": { "code": "OperationInProgress", "message": "Another operation is already using this digest.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `OperationInProgress` | Operation already in progress | Another call is working on the same digest. | Retry shortly. | Media type: application/json ```json { "error": { "code": "StorageFailed", "message": "The import store could not complete the storage operation.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `StorageFailed` | Storage operation failed | The import store could not complete the requested storage operation. | Inspect `error.retryable` and retry when an unchanged request can succeed. | ## Delete a snapshot artifact `DELETE /api/v1/vm/imports/{sha256}` Deletes a published artifact or discards an unfinished upload. The operation cannot be undone. VMs already created from the artifact are unaffected because creating a VM copies the artifact's contents. A create that is already rebuilding a VM from the artifact also completes normally. The call is refused with 409 while an upload, finalize, or another delete is working on the same digest, or while a create is still opening the artifact. Retry shortly in those cases. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `sha256` | `path` | `string` | Yes | The artifact's SHA-256 digest, exactly 64 lowercase hexadecimal characters. | This endpoint takes no request body. ### Examples ```bash curl --globoff --request DELETE \ "https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com/api/v1/vm/imports/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://{projectId}-{computerId}-vm-1.{server}.computers.hoody.com' }); const sha256 = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'; await client.vm.imports.delete(sha256); ``` ### Response fields Error responses contain these fields: | Field | Type | Required | Description | |---|---|---|---| | `error` | `object` | Yes | Error details. | | `error.code` | `string` | Yes | A fixed error code. Branch on this value rather than `error.message`. | | `error.message` | `string` | Yes | Human-readable error information. | | `error.retryable` | `boolean` | Yes | Whether repeating the identical request could succeed without any other change. | ### Responses Media type: none The response has no body. Media type: application/json ```json { "error": { "code": "NameInvalid", "message": "The sha256 value must contain exactly 64 lowercase hexadecimal characters.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NameInvalid` | Invalid SHA-256 digest | The `sha256` path value is not exactly 64 lowercase hexadecimal characters. | Replace it with the artifact's 64-character lowercase hexadecimal digest. | | `SpecInvalid` | Invalid request specification | The endpoint accepts no query parameters, so a request containing any is refused. | Remove all query parameters and repeat the request. | Media type: application/json ```json { "error": { "code": "NotFound", "message": "No artifact or upload matches the requested digest.", "retryable": false } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `NotFound` | Artifact not found | No published artifact or upload has the requested digest, so there is nothing to delete. | Verify the digest or list the artifacts in the import store. | Media type: application/json ```json { "error": { "code": "OperationInProgress", "message": "Another operation is still using this digest.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `OperationInProgress` | Operation already in progress | An upload, finalize, or another delete is working on the digest, or a create is still opening the artifact. A create that has moved on to rebuilding the VM does not block deletion and completes normally. | Retry shortly. | Media type: application/json ```json { "error": { "code": "StorageFailed", "message": "The import store could not complete the storage operation.", "retryable": true } } ``` | Error Code | Title | Description | Resolution | |---|---|---|---| | `StorageFailed` | Storage operation failed | The import store could not complete the requested storage operation. | Inspect `error.retryable` and retry when an unchanged request can succeed. |