# List public ports

URL: https://heaven.dev/docs/reference/computers/port-view
Updated: 2026-11-21

List published TCP ports and the remaining allowance, including how many new ports a pool can add in a 24-hour window. Name a Computer to see its public endpoints and recently removed ports it can reclaim. Without a Computer or `organization`, the view covers your accounts subject to your credential's scope.

`GET /v1/computer/?view=port`

## Parameters

- `computer` (string): Computer name or ID.
- `organization` (string): Organization name or ID. Omit to read across your accounts within your credential's scope. Supply either an organization or a Computer.

## Returns

- `data` (object, always present): Published ports and pool allowances.
  - `kept` (object[]): Recently released ports, included for Computer-specific reads. Adding the guest port again reclaims its public port. May be omitted.
    - `items` (object): A recently released public port retained for this Computer for 30 days.
      - `address` (string, always present): Address it would be published on now.
      - `guest_port` (integer, always present): Guest port to add again to reclaim this public port.
      - `port` (integer, always present): Retained public port number.
      - `released_at` (string (date-time), always present): When the port was released.
  - `pools` (object[] | null, always present): Port availability and usage for each selected pool.
    - `items` (object): A pool's public-port usage and availability.
      - `allowed` (integer, always present): Applicable public-port allowance.
      - `held` (integer, always present): Public ports held by this pool's Computers.
      - `id` (string, always present): Pool ID.
      - `name` (string, always present): Pool name.
      - `new_left` (integer, always present): New ports available within the rolling 24-hour limit. Reclaimed ports are excluded.
      - `new_next_at` (string (date-time)): When the new-port allowance next increases. May be omitted.
      - `offered` (boolean, always present): Whether the pool has an address on which ports can be published.
      - `organization` (string): Owning organization. May be omitted.
      - `reason` (string): Why publishing is unavailable. May be omitted.
      - `shared` (boolean): Whether pools in the same account and placement share this allowance. May be omitted.
      - `shared_held` (integer): Ports held across that shared allowance. May be omitted.
  - `ports` (object[] | null, always present): Currently published ports.
    - `items` (object): A public port forwarding traffic to a Computer.
      - `address` (string, always present): Public connection address.
      - `computer_id` (string, always present): Computer ID.
      - `guest_port` (integer, always present): Destination port inside the Computer.
      - `name` (string, always present): Computer name.
      - `organization` (string): Computer's organization, when applicable. May be omitted.
      - `port` (integer, always present): Public port to connect to.
      - `published_at` (string (date-time), always present): When the port was published.

## Errors

Each code is explained in full at https://heaven.dev/docs/reference/errors.

| Code | Status | What happened |
|---|---:|---|
| `invalid` | 400 | An input is missing or invalid. |
| `unauthenticated` | 401 | The credential is missing, invalid, expired or revoked. |
| `denied` | 403 | The caller lacks permission for this action. |
| `not_found` | 404 | The resource is absent or inaccessible to this caller. |
| `conflict` | 409 | The request conflicts with the current resource state or an earlier request. |
| `over_capacity` | 409 | The request exceeds a resource or credential allowance. |
| `access_list_full` | 409 | The change would exceed the access-list allowance. |
| `rate_limited` | 429 | The caller's request rate exceeds its limit. |
| `busy` | 429 | Too much work is in progress to accept this request. |
| `unknown` | 503 | The outcome is unconfirmed; a change may have happened. |
| `unavailable` | 503 | The service or requested feature is unavailable. |

## Notes

- API key permission: `port view`.

## Examples

```sh tab="heaven CLI"
heaven port view [COMPUTER]
  [--organization ORGANIZATION]
```

```sh tab="SSH"
ssh cli@heaven.dev port view [COMPUTER]
  [--organization ORGANIZATION]
```

```sh tab="cURL"
curl "https://heaven.dev/v1/computer/?view=port" \
  -H "Authorization: Bearer $HEAVEN_API_KEY"
```

```json tab="MCP"
{ "tool": "port_view",
  "arguments": {  } }
```

Response:

```json title="Response excerpt"
{
  "version": 1,
  "data": {
    "pools": [
      {
        "allowed": 5,
        "held": 0,
        "id": "pool-b07f4256830b2115",
        "name": "web",
        "new_left": 10,
        "offered": true,
        "organization": "acme",
        "shared": true
      }
    ],
    "ports": []
  }
}
```
