v106

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-02160524464.6 KB
Human-in-the-Loop

Preview URL

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

post/api/v1/runs/{id}/preview

Path parameters

idstring required

Unique run identifier (ULID).

Request body

portinteger required

Port number exposed by the sandbox.

expires_in_secsinteger required

Time-to-live for the preview URL in seconds.

signedboolean

When true, return a signed URL that does not require a preview token header.

Example request

{
  "port": 3000,
  "expires_in_secs": 3600
}

Response

Preview URL created

urlstring required

Preview URL.

tokenstring

Preview token header value for unsigned preview URLs.

Example response

{
  "url": "https://preview.example.com/sb-a1b2c3d4/3000",
  "token": "preview-token-123"
}