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>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
sandboxId*stringapplication/json- body
port*integer1 <= value <= 65535access?stringpublic answers a URL anyone who knows it can open; signed, a URL that carries a signature.
"public""public""signed"expiresInSeconds?integerA signed URL's life, cut to the sandbox's end. Read only with access signed.
1 <= value <= 864003600The exposed port
application/json- response
port*integerurl*stringuriaccess?"signed"signed on a signed port's answer; a public port's answer has no access.
"signed"expiresAt?stringWhen a signed URL stops opening the port.
date-timecurl -X POST 'https://api.openrelay.inc/v1/sandboxes/string/ports' \ -H 'Content-Type: application/json' \ -d '{ "port": 1}'{ "port": 0, "url": "http://example.com", "access": "signed", "expiresAt": "2019-08-24T14:15:22Z"}Write a file into a sandbox PUT
Writes bytes to a file inside a sandbox, creating or replacing it. The parent directory must exist; repeating the same write is safe. The request body is written to path, created if missing and truncated if not. A client may retry the same bytes after a lost connection.
Stop exposing a port of a sandbox DELETE
Stops traffic to an exposed sandbox port and invalidates its public and signed URLs within 5 seconds. Repeating the call is safe. A port that is not exposed answers the same. Exposing the port again makes new URLs: none signed before opens it.