Get the public access endpoint URL for accessing a service running on a specific port within the sandbox. The service must be listening on the specified port inside the sandbox for the endpoint to be available.
Path Parameters
Unique sandbox identifier
Port number where the service is listening inside the sandbox
- Minimum: 1
- Maximum: 65535
Query Parameters
Whether to return a server-proxied URLDefault: false
Response
Public URL to access the service from outside the sandbox.Format: {endpoint-host}/sandboxes/{sandboxId}/port/{port}Example: endpoint.opensandbox.io/sandboxes/abc123/port/8080
Requests targeting the sandbox must include the corresponding header(s).Key-value pairs where keys are header names and values are header values.
Unique request identifier for tracing
Status Code
Endpoint retrieved successfully.Returns the public URL for accessing the service on the specified port.
Error Responses
Authentication credentials are missing or invalid
The authenticated user lacks permission for this operation
The requested sandbox does not exist
An unexpected server error occurred
Example Request
curl -X GET http://localhost:8080/v1/sandboxes/sandbox-abc123/endpoints/8080 \
-H "OPEN-SANDBOX-API-KEY: your-api-key"
Example Response
{
"endpoint": "endpoint.opensandbox.io/sandboxes/sandbox-abc123/port/8080",
"headers": {
"X-Sandbox-Token": "token-value"
}
}
Usage Notes
Service Availability
The service must be actively listening on the specified port inside the sandbox for the endpoint to be functional. If your application hasn’t started listening yet, the endpoint URL will be returned but connections may fail until the service is ready.
When making requests to the returned endpoint URL, you must include any headers specified in the headers field of the response. These headers are required for authentication and routing to the correct sandbox.
curl http://endpoint.opensandbox.io/sandboxes/sandbox-abc123/port/8080 \
-H "X-Sandbox-Token: token-value"
Common Use Cases
- Web Applications: Access web servers running inside sandboxes (e.g., Flask, Express)
- APIs: Connect to API servers for testing or integration
- Development Servers: Access development tools like Jupyter notebooks or debugging interfaces
- Database Connections: Connect to databases running in sandboxes (though consider using internal networking for production)
Port Forwarding
The endpoint acts as a public gateway to services inside the sandbox. The sandbox’s internal port is mapped to the public endpoint URL, allowing external access without exposing the sandbox directly.
Security Considerations
- Endpoint URLs include authentication tokens in the required headers
- Endpoints are scoped to specific sandboxes and ports
- Access is controlled via API key authentication
- Consider using
use_server_proxy=true for additional security layers
Server Proxy Mode
When use_server_proxy=true is specified, the returned endpoint URL will route through a server-side proxy for additional security and monitoring capabilities.
curl -X GET "http://localhost:8080/v1/sandboxes/sandbox-abc123/endpoints/8080?use_server_proxy=true" \
-H "OPEN-SANDBOX-API-KEY: your-api-key"
Benefits of server proxy mode:
- Enhanced security through additional authentication layers
- Request/response logging and monitoring
- Rate limiting and access control
- Protocol translation and compatibility layers