Create a sandbox
Creates a sandbox with no network, no secrets and a time limit. A retry with the same Idempotency-Key returns the same sandbox, also with 201.
/v1/sandboxesAuthorizationBearer token (ibk_<public id>_<secret>) · headerrequiredA lane's API key. The lane is taken from the key, never from the request.
Idempotency-KeystringMakes a retry safe. A retry with the same key and body gets the answer described for this operation; the same key with a different body gets 409 idempotency_mismatch. Keys are kept for 24 hours. The SDKs send a fresh key on every call they may retry.
application/jsonimagestringThe image to create the sandbox from, an img_ id of this lane that is ready. When absent, the lane's default image. An image that is not ready gets 409 image_not_built; an unknown one gets 404 not_found.
lifetime_msintegerHow long the sandbox may live, in milliseconds. At most 300000; 120000 when absent.
namestringA name the caller chooses: lowercase letters, digits and dashes, up to 63 characters. No two pending or running sandboxes in a lane share a name; a stopped or removed sandbox's name may be used again. Used to remove the sandbox by name after a crash.
regionstringThe region the caller expects. Region is a lane setting; if this differs from the lane's, the create gets 400 region_mismatch.
resourcesResourceRequestCPU and memory for the sandbox. Each value is optional; the lane's default fills any gap. A value above the lane's cap is refused with 400 resources_over_cap.
Show propertiesHide properties
cpunumberCPU cores requested. Fractions are allowed.
cpu_limitnumberCPU cores the sandbox may use at most. At least cpu.
memory_limit_mibintegerMemory the sandbox may use at most, in MiB. At least memory_mib.
memory_mibintegerMemory requested, in MiB.
storeStoreRequestA read-only folder of the lane's store, attached at create. A lane with no store folder attached gets 409 store_unavailable.
Show propertiesHide properties
key_prefixstringrequiredA prefix in the lane's store folder, relative to the lane's root prefix: no leading /, ends in /, no . or .. segment. The platform may still refuse it with 400 store_prefix_refused.
mount_pathstringrequiredWhere the folder appears in the sandbox: an absolute path inside workdir.
workdirstringrequiredThe working directory, an absolute path. It is made at create.
The sandbox.
created_atstring<date-time>requiredA UTC time in RFC 3339 form.
idstringrequiredThe sandbox id, sbx_....
lifetime_msintegerrequirednamestring | nullrequiredThe caller's name, or null.
regionstringrequiredresourcesResourcesrequiredThe CPU and memory in effect, after lane defaults.
Show propertiesHide properties
cpunumberrequiredcpu_limitnumberrequiredmemory_limit_mibintegerrequiredmemory_mibintegerrequiredstatusSandboxStatusrequiredpending while the create is in flight, running once it can take calls, stopped once its lifetime or size limit was reached or it was removed. A create that fails leaves no sandbox, so a later GET answers 404.
pendingrunningstoppedstoreStore | nullrequiredThe attached store folder, or null when none was asked for.
Show propertiesHide properties
key_prefixstringrequiredmount_pathstringrequirednullworkdirstringrequiredinvalid_request: The request does not match the contract. region_mismatch: region differs from the lane's region. resources_over_cap: A resources value is above the lane's cap. store_prefix_refused: The store key_prefix is not allowed for this lane.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.
unauthorized: The API key is missing, unknown or revoked.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.
not_found: No such resource in this key's lane. Another lane's ids are not found either.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.
in_progress: A call with this Idempotency-Key is still running, or the sandbox is still being created. Retry later. idempotency_mismatch: The Idempotency-Key was used before with a different body. name_in_use: A pending or running sandbox in this lane already has this name. A stopped or removed sandbox's name may be used again. image_not_built: The image is not ready. On a create: its build is still running, or it failed; check the image, then create the sandbox again. On getting an image: the image has no build on the lane's current provider; rebuild it. That arises only after a lane changes provider. store_unavailable: This lane has no store folder attached.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.
lane_limit: The lane already runs its maximum number of sandboxes.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.
internal_error: The platform failed. A retry may succeed; for a call that creates or writes, retry with the same Idempotency-Key.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.
unavailable: A service behind the API could not be reached. Retry after a short wait; for a call that creates or writes, with the same Idempotency-Key.
errorErrorDetailrequiredShow propertiesHide properties
codestringrequiredA stable, machine-readable code. Known codes: env_name_refused, file_not_found, file_too_large, idempotency_mismatch, image_not_built, in_progress, internal_error, invalid_request, lane_limit, name_in_use, not_found, payload_too_large, resources_over_cap, region_mismatch, sandbox_stopped, unavailable, store_prefix_refused, store_unavailable, unauthorized. New codes may be added, so treat an unknown one by its HTTP status.
messagestringrequiredA sentence for a person. Do not parse it.
request_idstringrequiredThe same value as the X-Request-Id header.