Expose a port
Give a port inside the sandbox an HTTPS URL, to reach a web server or API you started in it. The service must listen on 0.0.0.0. A sandbox exposes at most 20 ports.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Path parameters
sandboxIdstringrequiredSandbox ID.
Body
application/json
portintegerrequiredPort your service listens on inside the machine.
Limitsmin 1 · max 65535publicbooleanfalsereturns a URL with an access token in its query string: anyone holding the full URL can open it, so treat it as a secret. Opened in a browser, the token moves into a cookie for that host and leaves the address bar, so the page's own links, assets and WebSockets work. Other clients send it as?_token=on every request.truereturns a URL anyone can open. Calling again with a different value changes it for the same URL.Defaultfalse
Responses
200The URL.
portobjectrequired3 properties
portintegerrequiredurlstring<uri>requiredHTTPS URL on
zavu.runthat reaches the port, WebSockets included. Calling this again for the same port returns the same URL. It keeps working across a stop and resume; while the sandbox is stopped it answers503, and once the sandbox is deleted it answers404.publicbooleanrequired
400Invalid port.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
404Sandbox not found, or it belongs to another project.
codestringrequiredmessagestringrequireddetailsobject
409`sandbox_not_running`: the sandbox is stopped, stopping, failed or deleted; resume it first. `sandbox_not_ready`: it is still starting and did not become ready in time; retry. `port_limit_reached`: it already exposes 20 ports.
codestringrequiredmessagestringrequireddetailsobject
503`sandbox_unavailable`: ports cannot be exposed right now; retry shortly.
codestringrequiredmessagestringrequireddetailsobject