---
title: "Ports · intentic sandbox API"
description: "What is listening inside the sandbox, and forwarding one out. Every route in the ports group of the intentic sandbox API, with its input, its answer and a playground."
url: "https://intentic.dev/api/ports/"
---

The workspace

# Ports

What is listening inside the sandbox, and forwarding one out

**On this page (3 sections)**

- [What is listening inside the sandbox](#ports-list)
- [Make a port reachable](#ports-forward)
- [Stop exposing a port](#ports-unforward)

The ports something is answering on, and giving one an address on the outside or taking that away.

**GET`/ports` What is listening inside the sandbox**

Every port something is answering on, and whether each one is reachable from outside.

### What you send

Nothing. Call it as it is.

### What comes back

| Field | Type |
| --- | --- |
| `ports` Everything listening inside the sandbox right… | object[] |
| `port` The port number | number |
| `host` Which loopback address it actually answers… | "127.0.0.1" | "::1" |
| `forwardable` Whether it can be exposed at… | boolean |
| `kind` Whether somebody's own work put it… | "workspace" | "system" |
| `title` What a person would call it | string |
| `purpose` One sentence about what it is… | string |
| `origin` Who put it there, which is… | "terminal" | "agent" | "panel" | "extension" … (7) |
| `pid` The process holding it | number |
| `command` The command behind it, as it… | string |
| `cwd` Where it is running from, which… | string |
| `session` The terminal it came from, to… | string |
| `forwarded` Whether it is currently reachable from… | boolean |
| `previewUrl` Where to open it | string |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/ports" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.ports.list();
```

**POST`/ports/forward` Make a port reachable**

Gives one port an address on the outside. Asking twice is harmless: the second call hands back the address the first one made.

### What you send

| Field | Type | Where |
| --- | --- | --- |
| `port` required Which port | integer | body |

### What comes back

| Field | Type |
| --- | --- |
| `previewUrl` Where it can now be reached | string |

Try it answered in this tab

curl

```bash
curl -X POST "$SANDBOX/ports/forward" \
 -H "x-intentic-control: $INTENTIC_TOKEN" \
 -H "content-type: application/json" \
 -d '{"port":5173}'
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.ports.forward({
 "port": 5173
});
```

**POST`/ports/unforward` Stop exposing a port**

Frees the slot at once. The address keeps resolving; it simply stops leading anywhere.

### What you send

| Field | Type | Where |
| --- | --- | --- |
| `port` required Which port | integer | body |

### What comes back

| Field | Type |
| --- | --- |
| `ok` Always true | true |

Try it answered in this tab

curl

```bash
curl -X POST "$SANDBOX/ports/unforward" \
 -H "x-intentic-control: $INTENTIC_TOKEN" \
 -H "content-type: application/json" \
 -d '{"port":5173}'
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.ports.unforward({
 "port": 5173
});
```

More in The workspace

[Previous ← Panels](https://intentic.dev/api/panels/)
