---
title: "Expose an HTTP port"
description: "Select one HTTP port for the computer's HTTPS URL without starting or stopping programs or changing sharing."
canonical: "https://www.cool.computer/docs/api-reference/services/expose-an-http-port"
---
# Expose an HTTP port

> Select one HTTP port for the computer's HTTPS URL without starting or stopping programs or changing sharing.

```http
PUT https://api.cool.computer/api/computers/{id}/exposure
```

Select one HTTP port for the computer's HTTPS URL without starting or stopping programs or changing sharing. Replaces the prior selected port. A refused listener is reported on access rather than substituting another port. Only running computers can be changed; a site with no VM answers 409 needs_vm (POST /api/computers/{id}/service/run starts a program and gives it a VM). On a site with a VM, the port takes every path but the functions' (/api) for good: its files in /home/runtime/app are never served as files again.

## 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.

## Request body

Required.

- `application/json` (object)
  - `port` (integer, 1 to 65535, not 3129, 18080, 18088, required)

## Responses

- `200`: The selected HTTP target and existing sharing policy. Port zero means no exposure; this does not assert application health.
  - `application/json` (object)
    - `url` (string, required): The computer's stable HTTPS URL, regardless of whether a route is selected.
    - `port` (integer, 0 to 65535, not 3129, 18080, 18088, required): Selected HTTP target. Zero means unexposed; not a health check.
    - `visibility` ("public" or "private", required)
- `400`: A machine-readable error. Authorization and compute-access policy remain enforced.
- `401`: A machine-readable error. Authorization and compute-access policy remain enforced.
- `402`: Payment Required. `pro_required`: VMs need Pro; start Pro with cool billing upgrade, or fix a lapsed subscription with cool billing portal, or use the Account page.
- `403`: A machine-readable error. Authorization and compute-access policy remain enforced.
- `404`: A machine-readable error. Authorization and compute-access policy remain enforced.
- `409`: A machine-readable error. Authorization and compute-access policy remain enforced.
- `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.
- `500`: A machine-readable error. Authorization and compute-access policy remain enforced.
- `default`: A machine-readable error. Authorization and compute-access policy remain enforced.

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 PUT "https://api.cool.computer/api/computers/$PARAM_ID/exposure" \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  --data '{"port":1}'
```
