Skip to content
Overview

Sandbox API Overview

Sufy Sandbox Open API lets you manage sandbox instances, templates, and secret injection rules over HTTP. All APIs use a region-specific host. Choose the endpoint that matches the region where your sandbox is deployed.

Service Endpoints

RegionRegion IDAPI Endpoint
United States (Dallas 1)us-south-1https://us-south-1-sandbox.sufyapi.com

Authentication

Sandbox instance and template management APIs use the X-API-Key request header:

http
X-API-Key: <SUFY_API_KEY>

Some template build APIs also accept an API key in Bearer format:

http
Authorization: Bearer <SUFY_API_KEY>

For template build APIs, send the API key as a Bearer token when the endpoint requires it.

Secret injection rule management APIs use the Sufy account authorization header:

http
Authorization: Sufy <SignedToken>

SignedToken is generated by signing the request with your Sufy AK/SK.

You can get SUFY_API_KEY from Sufy API Key Management.

Common Headers

HeaderRequiredDescription
X-API-KeyRequired by some APIsAPI key for sandbox instance and template management APIs
AuthorizationRequired by some APIsBearer API key for template build APIs, or Sufy signature for secret injection rule APIs
Content-TypeRequired when a request body is presentAlways application/json

API Groups

GroupDocumentationDescription
Sandbox InstancesSandbox InstancesCreate, query, connect, pause, resume, and delete sandboxes, and query logs and metrics
TemplatesTemplatesCreate templates, upload build files, start builds, and query template and build status
Secret InjectionSecret InjectionManage reusable HTTPS request secret injection rules stored by the platform
Sandbox RuntimeSandbox RuntimeAccess envd runtime status, environment variables, and resource metrics
Processes and TerminalsProcesses and TerminalsStart commands through envd, connect to processes, send input, and manage PTYs
File SystemFile SystemRead and write files through envd, list directories, move or delete files, and watch directory changes

Error Responses

API errors are returned as JSON:

FieldTypeDescription
codeintegerError code
messagestringError message

Example:

json
{
  "code": 400,
  "message": "invalid request"
}

Status Codes

Status CodeDescription
200Request succeeded
201Resource created
202Request accepted and an async task has started
204Request succeeded with no response body
400Invalid request parameters
401Authentication failed
403Permission denied
404Resource not found
409Current resource state conflicts with the request
500Server error

Request Example

bash
curl -X GET "$SUFY_SANDBOX_API_URL/v2/sandboxes" \
  -H "X-API-Key: $SUFY_API_KEY"