Sandbox API
Use an account key to create and manage Windows sandboxes from your agent. These examples describe the API in development. Request access.
Request a machine
Set WIN_BOXES_URL to the service URL supplied with access and WIN_BOXES_KEY to a key from your account. For retries, reuse the same idempotency key and body.
curl --fail-with-body -X POST "$WIN_BOXES_URL/v1/win_boxes/boxes" \
-H "Authorization: Bearer $WIN_BOXES_KEY" \
-H "Idempotency-Key: $REQUEST_ID" \
-H "Content-Type: application/json" \
-d '{"route":"aws-spot","template_id":"standard"}'Use azure or aws-spot for the route. A create request returns id and box_id. Poll GET /v1/win_boxes/operations/{id} until status is succeeded. If it is failed, read error. Spot capacity can be interrupted.
Run a Windows program
Send a POST to /v1/win_boxes/boxes/{box_id}/commands with the same authorization header and a new request ID.
{
"program": "cmd.exe",
"args": [
"/d",
"/c",
"ver"
]
}Boxes and templates
All paths below are relative to /v1/win_boxes. For a Windows Home clone or template, specify {"mode":"disk"} and wait for the operation to finish. The source shuts down and restarts. Installed programs and files carry over. Running programs do not resume in the copy. For a template, also send a name. To provision from it later, use the returned template ID and the same cloud route.
- GET
/boxes - List your account’s boxes.
- GET
/boxes/{box_id} - Read the box state and its cloud route.
- POST
/boxes/{box_id}/commands - Run a program with an argument array. The operation carries its result.
- POST
/boxes/{box_id}/exec-output - Read another page of command output using source_task_id and output_offset.
- POST
/boxes/{box_id}/clones - Create a disk clone on the same host. Send {"mode":"disk"} for Windows Home.
- POST
/boxes/{box_id}/templates - Save the disk as a reusable template. Send a name and mode of disk.
- GET
/templates - List templates available to this account.
- GET
/boxes/{box_id}/network - Request a list of observed outbound IPv4 destinations, protocols and ports. Poll the operation for its result. To continue, pass next_cursor in the cursor query parameter.
- DELETE
/boxes/{box_id} - Destroy the box. The service releases a host after its last box is removed.
- GET
/operations/{id} - Read the outcome of an asynchronous request.
Top-ups and usage
Read GET /v1/billing/quote?route=azure for the host rate and required reservation. GET /v1/billing/balance returns the account balance. Once paid access opens, POST /v1/billing/checkout with {"amount_cents":2500} requests a checkout for a $25 top-up.