---
title: "Preview URL"
method: POST
path: "/api/v1/runs/{id}/preview"
tags: ["Human-in-the-Loop"]
---

# Preview URL

`POST /api/v1/runs/{id}/preview`

Generates a preview URL for a port exposed by the run's sandbox environment.

## Path parameters

- `id` string, required

## Request body

- PreviewUrlRequest — Request body for generating a preview URL from a sandbox port.
  - `port` integer, required — Port number exposed by the sandbox.
  - `expires_in_secs` integer, required — Time-to-live for the preview URL in seconds.
  - `signed` boolean — When true, return a signed URL that does not require a preview token header.

## Response `201`

Preview URL created

- PreviewUrlResponse — Response containing the generated preview URL.
  - `url` string, required — Preview URL.
  - `token` string — Preview token header value for unsigned preview URLs.

## Other responses

- `404` — Run not found
- `409` — Run has no active sandbox

---

[API](https://skmtc.net/fabro-sh/apis/fabro-run-api.md) · [All operations](https://skmtc.net/fabro-sh/apis/fabro-run-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fabro-sh/fabro-run-api/versions/bee030053823/schema)
