---
raw: true
search:
  tags:
    - Versions
    - POST
seo:
  description: >-
    Compiles and activates an uploaded version.… Reference for the POST
    /v1/spaces/{spaceId}/versions/{versionId}/finalize endpoint in the Spacefast
    Partner API.
sidebar:
  label: Finalize a version
  badge: POST
title: Finalize a version
type: openapi-operation
---
Compiles and activates an uploaded version. Waits for completion by default. Pass `async=1` to get an operation handle to poll instead.

`POST /v1/spaces/{spaceId}/versions/{versionId}/finalize`

**Request body** (`application/json`, required)

- `channel` (string | null) — Omit for live publish, use production as an alias for live, or pass null to finalize the version without promoting it.

Request body example:

```json
{
  "channel": "live"
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200 · Finalize waited for the version and returned it ready.:

```json
{
  "data": {
    "id": "ver_2b9e7d4c1a6f8b3e0d5c9a2f7e4b1d8c",
    "ref": "v1",
    "number": 1,
    "spaceId": "spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c",
    "source": {
      "kind": "direct_upload",
      "client": "spacefast-cli/1.4.0",
      "message": "Initial launch"
    },
    "status": "ready",
    "failureCode": null,
    "failureMessage": null,
    "failedStage": null,
    "manifestHash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "buildId": null,
    "gitCommitSha": null,
    "importedFromVersionId": null,
    "variables": null,
    "fileCount": 2,
    "totalBytes": 2560,
    "filesAddedCount": 2,
    "filesChangedCount": 0,
    "filesRemovedCount": 0,
    "pendingUploads": [],
    "skippedPaths": [],
    "immutableUrl": "https://marketing-site--v1.space.fast/",
    "isCurrentProduction": true,
    "siteTitle": "Marketing site",
    "config": null,
    "operation": null,
    "headersRuleCount": 0,
    "redirectsRuleCount": 0,
    "proxyRouteCount": 0,
    "runtimeCodeDetected": false,
    "buildLog": null,
    "diagnostics": [],
    "createdAt": "2026-06-30T12:00:00.000Z",
    "readyAt": "2026-06-30T12:00:03.000Z",
    "updatedAt": "2026-06-30T12:00:03.000Z"
  },
  "operation": null
}
```

Response example, 200 · \`async=1\`: the version as accepted, plus the operation to poll.:

```json
{
  "data": {
    "id": "ver_2b9e7d4c1a6f8b3e0d5c9a2f7e4b1d8c",
    "ref": "v1",
    "number": 1,
    "spaceId": "spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c",
    "source": {
      "kind": "direct_upload",
      "client": "spacefast-cli/1.4.0",
      "message": "Initial launch"
    },
    "status": "finalizing",
    "failureCode": null,
    "failureMessage": null,
    "failedStage": null,
    "manifestHash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "buildId": null,
    "gitCommitSha": null,
    "importedFromVersionId": null,
    "variables": null,
    "fileCount": 2,
    "totalBytes": 2560,
    "filesAddedCount": 2,
    "filesChangedCount": 0,
    "filesRemovedCount": 0,
    "pendingUploads": [],
    "skippedPaths": [],
    "immutableUrl": "https://marketing-site--v1.space.fast/",
    "isCurrentProduction": false,
    "siteTitle": "Marketing site",
    "config": null,
    "operation": {
      "id": "op_5e2c9b7a13d846f0a8b5c1e7d92f6403",
      "kind": "version_finalize",
      "status": "queued",
      "resources": [
        {
          "type": "version",
          "id": "ver_2b9e7d4c1a6f8b3e0d5c9a2f7e4b1d8c"
        },
        {
          "type": "space",
          "id": "spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c"
        }
      ],
      "createdAt": "2026-06-30T12:00:01.000Z"
    },
    "headersRuleCount": 0,
    "redirectsRuleCount": 0,
    "proxyRouteCount": 0,
    "runtimeCodeDetected": false,
    "buildLog": null,
    "diagnostics": [],
    "createdAt": "2026-06-30T12:00:00.000Z",
    "readyAt": null,
    "updatedAt": "2026-06-30T12:00:03.000Z"
  },
  "operation": {
    "id": "op_5e2c9b7a13d846f0a8b5c1e7d92f6403",
    "kind": "version_finalize",
    "status": "queued",
    "resources": [
      {
        "type": "version",
        "id": "ver_2b9e7d4c1a6f8b3e0d5c9a2f7e4b1d8c"
      },
      {
        "type": "space",
        "id": "spc_4a7f9c2e8b1d0a6f5c3e9d2b7a1f8e4c"
      }
    ],
    "createdAt": "2026-06-30T12:00:01.000Z"
  }
}
```
