Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
Skip to Content
API ReferenceComputeSandboxes

Expose a port of a sandbox at a public URL

Allows traffic to a port in the sandbox and answers the URL that reaches it. Exposing a public port again answers the same URL. With access signed, only a URL that carries a signature the router made reaches the port, and the answer is such a URL, valid for expiresInSeconds (default 3600) and never past the sandbox's end. Exposing a signed port again answers a fresh signed URL, and the URLs answered before keep working until their expiry or until the port is unexposed. Without the organization's signed previews, access signed is refused with 400.

Required permission

Requires the sandboxes.exec permission. See Permissions for the roles and API key permissions that include it.

Command line

The orl CLI wraps this endpoint:

Guided workflow: orl sandbox port expose

orl sandbox port expose <sandbox-id> <port>
POST
/v1/sandboxes/{sandboxId}/ports

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Path Parameters

sandboxId*string

Request Body

application/json
  1. body
port*integer
Range1 <= value <= 65535
access?string

public answers a URL anyone who knows it can open; signed, a URL that carries a signature.

Default"public"
Value in"public""signed"
expiresInSeconds?integer

A signed URL's life, cut to the sandbox's end. Read only with access signed.

Range1 <= value <= 86400
Default3600

Response Body

The exposed port

application/json
  1. response
port*integer
url*string
Formaturi
access?"signed"

signed on a signed port's answer; a public port's answer has no access.

Value in"signed"
expiresAt?string

When a signed URL stops opening the port.

Formatdate-time
Example Request
curl -X POST 'https://api.openrelay.inc/v1/sandboxes/string/ports' \  -H 'Content-Type: application/json' \  -d '{  "port": 1}'
Example Response
{  "port": 0,  "url": "http://example.com",  "access": "signed",  "expiresAt": "2019-08-24T14:15:22Z"}