---
title: "Publish a machine's cache disk."
method: POST
path: "/v1/machines/{id}/cache-disk/publish"
tags: ["cache-disks"]
---

# Publish a machine's cache disk.

`POST /v1/machines/{id}/cache-disk/publish`

## Request

- Base URL: `https://api.smolmachines.com`
- URL: `https://api.smolmachines.com/v1/machines/{id}/cache-disk/publish`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/smolmachines/apis/smolfleet-api/docs/v1/machines/:id/cache-disk/publish/post.ts> (a function with typed inputs; its response is checked against the schema)

Publishes a stopped machine's cache disk (the version it started from plus everything it wrote) as its cache disk's next version, which later machines can start from. Requires the `machine:create` scope.

## Path parameters

- `id` string, required

## Response `200`

New version published

- PublishCacheDiskResponse: The version a publish created, and the cache disk it now belongs to.
  - `cacheDisk` CacheDiskInfo, required: A cache disk: a disk image many machines start from, each through its own copy-on-write layer, published in immutable versions.
    - `createdAt` string, required
    - `id` string, required
    - `latestVersion` integer, required
    - `mountPath` string, required
    - `name` string, required
    - `sizeGb` integer, required
    - `versions` CacheDiskVersionInfo[], required: Newest first.
      - `createdAt` string, required
      - `sha256` string, required: SHA-256 (hex) of the version's disk image.
      - `sizeBytes` integer, required
      - `sourceMachineId` string, nullable: The machine whose cache this version was published from; `null` for v0.
      - `version` integer, required: 0 is the empty filesystem a cache disk starts as; each publish adds one.
  - `version` CacheDiskVersionInfo, required: One immutable version of a cache disk.
    - `createdAt` string, required
    - `sha256` string, required: SHA-256 (hex) of the version's disk image.
    - `sizeBytes` integer, required
    - `sourceMachineId` string, nullable: The machine whose cache this version was published from; `null` for v0.
    - `version` integer, required: 0 is the empty filesystem a cache disk starts as; each publish adds one.

## Other responses

- `400`: The machine has no cache disk
- `401`: Missing or invalid API key
- `403`: Key lacks the required scope
- `404`: Machine not found
- `409`: The machine is running or has never run
- `422`: Cache disks are not available on this platform
- `429`: Rate limited; retry after the Retry-After header
- `500`: Internal error

## Changes

- **2026-10-16** `bc31fc04a568`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smolmachines/apis/smolfleet-api/changes/v1/machines/:id/cache-disk/publish/post.md)

---

[API](https://skmtc.dev/smolmachines/apis/smolfleet-api.md) - [All operations](https://skmtc.dev/smolmachines/apis/smolfleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smolmachines/apis/smolfleet-api/revisions/bc31fc04a568?raw)
