porter-sandbox:
Porter
Porter is the top-level client. It exposes resource namespaces for sandboxes, volumes, health, and readiness.
| Option | Type | Description |
|---|---|---|
apiKey | string | undefined | Optional API key. Only required when invoking the Sandbox API from outside the sandbox-enabled cluster. Create one from Settings > API tokens in the Porter Dashboard. Creating API tokens requires admin permissions. |
baseUrl | string | undefined | Optional API base URL override. In-cluster Porter Applications use the in-cluster Sandbox API URL by default. |
timeoutMs | number | undefined | Request timeout in milliseconds. Defaults to 30 seconds. |
porter.sandboxes
create
| Option | Type | Description |
|---|---|---|
image | string | Container image to run. |
name | string | undefined | Optional cluster-unique sandbox name. Use lowercase letters, numbers, and hyphens; start and end with a letter or number. Names currently cannot be reused, even after termination. |
command | string[] | undefined | Optional entrypoint override. |
args | string[] | undefined | Optional arguments passed to the command. |
env | Record<string, string> | undefined | Environment variables to set in the sandbox. |
tags | Record<string, string> | undefined | Key-value labels for finding related sandboxes. |
volume_mounts | Record<string, string> | undefined | Volume IDs keyed by absolute mount path inside the sandbox. |
Sandbox handle.
get
Sandbox handle. Use names as the canonical reference for sandboxes you need to operate on later.
list
Sandbox
Sandbox is the handle returned by porter.sandboxes.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Sandbox identifier. |
phase | StatusResponsePhase | null | Last-known lifecycle phase. |
tags | Record<string, string> | null | Last-known tags. |
| Method | Description |
|---|---|
refresh() | Refetches status and updates phase and tags. |
exec(command) | Runs a command in the sandbox and returns stdout, stderr, and exit code. |
logs(options?) | Fetches structured log lines. |
terminate() | Terminates the sandbox. |
Volumes
Volumes are persistent storage that can be mounted into sandboxes.| Method | Description |
|---|---|
porter.volumes.list() | Lists volumes. |
porter.volumes.create(body) | Creates a volume. Pass a name when you need stable lookup later. |
porter.volumes.get(name) | Fetches a volume by name. |
porter.volumes.delete(name) | Deletes a volume by name. |
Low-level client
The top-level client exposes generated low-level clients through.raw:

