---
title: "Bake (or rebake) the workspace's golden snapshot"
description: "Runs the full bake inline and returns the settled state: ensure the base agent repo exists (generated from the platform base template on first use), boot a..."
api_method: POST
api_path: "/v1/workspaces/{workspaceId}/golden/bake"
canonical_url: https://wiblo.app/docs/developers/api/agent-golden/bake-workspace-golden
last_updated: 2026-07-28T17:31:44+02:00
md_url: https://wiblo.app/docs/developers/api/agent-golden/bake-workspace-golden.md
---

# Bake (or rebake) the workspace's golden snapshot

`POST /v1/workspaces/{workspaceId}/golden/bake`

Runs the full bake inline and returns the settled state: ensure the base agent repo exists (generated from the platform base template on first use), boot a throwaway sandbox, install bun + the pinned MIN Claude runtime (frozen install, musl pruned), clone `base/`, lay the root symlinks and the workspace.json marker, snapshot with no expiry, record the golden, and delete the superseded snapshot (safe — snapshots are self-contained, F-029). A fresh golden is a no-op unless `force` is set. Concurrent bakes coalesce on a DB claim; a caller that loses the claim waits for the winner. Takes ~10-20s (plus ~5s when the base repo is created first). Per-user rate-limited at 6/300s in its own bucket.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | `string` | Yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `force` | `boolean` | No | Defaults to `false`. |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/workspaces/{workspaceId}/golden/bake \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "force": true
}'
```

**TypeScript**

```ts
import { createSdk, bakeWorkspaceGolden } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await bakeWorkspaceGolden({
  client: sdk,
  path: { workspaceId: "..." },
  body: {
    "force": true
  },
})
```

## Responses

**`200`** — The golden's state after the bake settled. Returns `WorkspaceGoldenResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | `string` | Yes |  |
| `status` | `"none" \| "baking" \| "ready" \| "failed"` | Yes |  |
| `runtime` | `string` | Yes |  |
| `snapshot_id` | `string \| null` | No | Defaults to `null`. |
| `baked_sha` | `string \| null` | No | Defaults to `null`. |
| `runtime_pin` | `string \| null` | No | Defaults to `null`. |
| `current_runtime_pin` | `string \| null` | No | Defaults to `null`. |
| `layout_version` | `integer \| null` | No | Defaults to `null`. |
| `current_layout_version` | `integer` | Yes |  |
| `size_bytes` | `integer \| null` | No | Defaults to `null`. |
| `stale` | `boolean` | Yes |  |
| `error` | `string \| null` | No | Defaults to `null`. |
| `baked_at` | `string \| null` | No | Defaults to `null`. |
| `updated_at` | `string \| null` | No | Defaults to `null`. |
| `repo` | `WorkspaceGoldenRepo` | No |  |

**`401`** — No valid session or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`404`** — Workspace not visible to the caller (`WORKSPACE_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`422`** — Path param or body failed validation (`INVALID_PARAMS`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.

**`502`** — The sandbox host or git control plane is unavailable, or the bake failed (`UPSTREAM_UNAVAILABLE`). Returns `ApiErrorEnvelope`.

### The WorkspaceGoldenRepo object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes |  |
| `slug` | `string` | Yes |  |
| `url` | `string` | Yes |  |
| `default_branch` | `string` | Yes |  |
