Get Sandbox Endpoint
Lifecycle API
Get Sandbox Endpoint
Get public access endpoint for a service running in the sandbox
GET
Get Sandbox Endpoint
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.
Benefits of server proxy mode:
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:
falseResponse
Public URL to access the service from outside the sandbox.Format:
{endpoint-host}/sandboxes/{sandboxId}/port/{port}Example: endpoint.opensandbox.io/sandboxes/abc123/port/8080Requests targeting the sandbox must include the corresponding header(s).Key-value pairs where keys are header names and values are header values.
Response Headers
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
Example Response
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.Required Headers
When making requests to the returned endpoint URL, you must include any headers specified in theheaders field of the response. These headers are required for authentication and routing to the correct sandbox.
Example with Headers
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=truefor additional security layers
Server Proxy Mode
Whenuse_server_proxy=true is specified, the returned endpoint URL will route through a server-side proxy for additional security and monitoring capabilities.
- Enhanced security through additional authentication layers
- Request/response logging and monitoring
- Rate limiting and access control
- Protocol translation and compatibility layers