Public URLs ›
Create host route
POST
/v1/sandboxes/{id}/hostGive a port a public address.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- const route = await sandbox.expose(3000);
Answer201 Created · HostRoute
- {
- "id": string,
- "sandboxId": string,
- "port": integer,
- "title": string,
- "public": boolean,
- "hidden": boolean,
- "proxyPath": string,
- "registered": "true",
- "listening": boolean,
- … 2 more
- }
Route stored.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
portrequiredinteger | |
titlerequiredstring | |
publicrequiredboolean |
Returns
201 Route stored. proxyPath reaches this port when proxy is available and something is listening.
HostRoute11 fields
idstring
sandboxIdstring
portinteger
titlestring
publicboolean
True gives the port a public address, reported as url.
More
False keeps it behind proxyPath and your token.hiddenboolean
proxyPathstring
Path on this API that reaches the port.
More
Needs your token.registeredtrue
listeningboolean
proxyavailablenot_configured
available while the sandbox is running and its ports can be reached.
urlstringnull
Public address of the port: HTTP and WebSocket only, no token needed, and hard to guess.
More
It answers while the sandbox is running. Null when the route is not public or public addresses are off.Errors and other answers
| 404 | Not found. |
| 409 | route_limit_reached. The sandbox already has as many ports registered as it may. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.