---
title: "Finalize a release"
description: "Makes a fully uploaded release live. A computer without a VM serves it from its own release hostname r<n>--<name> and its URL."
canonical: "https://www.cool.computer/docs/api-reference/publishing/finalize-a-release"
---
# Finalize a release

> Makes a fully uploaded release live. A computer without a VM serves it from its own release hostname r<n>--<name> and its URL.

```http
POST https://api.cool.computer/api/computers/{id}/releases/{number}/finalize
```

Makes a fully uploaded release live. A computer without a VM serves it from its own release hostname r\<n>--\<name> and its URL. A release whose cool.json declares run gives the computer its VM with the release's files in /home/runtime/app (executables with mode 0755), which the VM's built-in site server serves, then starts the server and waits up to 60 seconds for its port to accept connections, as for POST /api/publish; the receipt then reports vm true and has no release_url. A computer that already has a VM takes no release: finalizing one of its releases still uploading fails it with computer_has_vm. Repeating finalize returns the same receipt.

## Authorization

- A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.

## Parameters

- `id` (path, string, at least 1 characters, required): The computer's name, such as agent-atlas, or its id (cmp_…). Every caller may use either, the computer's own runtime token included.
- `number` (path, integer, at least 1, required): Release number, starting at 1 for each computer.

## Responses

- `200`: The receipt of the live release.
  - `application/json` (object)
    - `release` (object, required)
      - `number` (integer, at least 1, required)
      - `state` ("uploading" or "ready" or "failed", required)
      - `live` (boolean, required)
      - `files` (integer, at least 0, required)
      - `bytes` (integer, int64, at least 0, required)
      - `created_at` (string, date-time, required)
      - `ready_at` (string, date-time)
    - `url` (string, uri, required): The computer's URL, which serves the live release.
    - `release_url` (string, uri): This release's own hostname r\<n>--\<name>. Absent once the computer's VM serves its URL.
    - `vm` (boolean, required): Whether the computer's VM serves its URL, because a server on it answered.
    - `next` (object, required): What to do next: upload the missing hashes, finalize, or nothing (done).
      - `action` ("upload" or "finalize" or "done", required)
      - `upload` (object)
        - `method` ("PUT" or "POST", required)
        - `href` (string, required): API path; {sha256} stands for each missing hash.
      - `finalize` (object)
        - `method` ("PUT" or "POST", required)
        - `href` (string, required): API path; {sha256} stands for each missing hash.
- `400`: Bad Request. `invalid_release`: cool.json or a limit rejected the release, which is marked failed.
- `401`: Unauthorized.
- `402`: Payment Required. `pro_required`: a release that declares run needs a VM, and VMs need Pro; start Pro with cool billing upgrade, or fix a lapsed subscription with cool billing portal, or use the Account page.
- `403`: Forbidden.
- `404`: Not Found. `release_not_found` when the release does not exist.
- `409`: Conflict. `blobs_missing`: upload the hashes in `context.missing`, then finalize again. `release_failed`: create a new release. `computer_has_vm`: the computer has a VM, so publishing cannot change it; the release is marked failed. `publish_in_progress`: another publish of the computer is running. `job_taken_over`: as for POST /api/publish, after Operator took over your local agent session's comments job on the site.
- `422`: Unprocessable Content. `release_has_no_files`: no file of a release without run is served (hidden files and node_modules never are); the release is marked failed. `slug_too_long_for_releases`: the computer's name leaves no room for this release's hostname r\<n>--\<name>. `functions_and_run`: cool.json declares both functions and run; the release is marked failed. `secret_set_not_found` or `secret_set_too_large`: cool.json secrets names a set the account does not have, or one larger than functions on the edge take (64 keys of at most 5,000 bytes); the release is marked failed.
- `429`: Too Many Requests. If the problem code is api_request_rate_exceeded, wait for Retry-After seconds; other problem codes describe a separate limit. computer_quota_exceeded means the account's VM quota is full.
- `500`: Internal Server Error.
- `502`: Bad Gateway. `artifact_deploy_failed`: finalize again, unless its resolution says the link to the computer's VM did not move; then do what that resolution says. `linux_create_failed`: giving the computer its VM failed and it stays a published site; `server_start_failed`: after the computer got its VM with the release's files, its program failed to start or ended before its port accepted connections; `context.step` names the failing step, the release is live, and the computer keeps its VM, so fix the program there with the files API or exec and start it on the port the resolution names. If its link did not move to the VM either, POST /api/computers/{id}/vm finishes moving it.
- `503`: Service Unavailable. `artifacts_unavailable` means publishing is not configured on this server; `host_capacity_full` or `host_capacity_unavailable` means a release that declares run cannot get a VM now.
- `default`: A machine-readable API error with a stable code and recovery instruction.

An error is an `application/problem+json` document with a stable `code`; [API errors](/docs/api-reference/errors) says how to handle one.

## Example

```sh
curl -X POST "https://api.cool.computer/api/computers/$PARAM_ID/releases/$PARAM_NUMBER/finalize" \
  -H "authorization: Bearer $TOKEN"
```
