Run a command
Runs a command and waits for it, up to timeout_ms. A retry with the same Idempotency-Key gets 409 in_progress while the command runs, and the outcome with stdout null once it has finished.
/v1/sandboxes/{id}/execAuthorizationBearer token (ibk_<public id>_<secret>) · headerrequiredA lane's API key. The lane is taken from the key, never from the request.
idstringrequiredA sandbox id: sbx_ and a random part, at most 64 characters.
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/jsoncommandstring[]requiredThe program and its arguments, as an argv array. No shell runs unless the caller runs one.
cwdstringThe directory to run in. Defaults to the sandbox's workdir.
envobjectUp to 8 environment variables. A name that looks like a secret is refused with 400 env_name_refused.
timeout_msintegerHow long the command may run, in milliseconds. At most 120000, and that when absent. When it passes, the result is timed_out.
The command ended or timed out.
exit_codeintegerrequiredThe command's exit code.
outcomestringrequiredstdoutstring | nullrequiredStandard output, cut at the lane's cap (default 64 KiB). Null when the output is unavailable: a replayed exec (a retry of a finished command with the same Idempotency-Key, which returns the outcome but not the output, because the platform keeps no output), or a timed-out one in this version. stdout_truncated is false whenever stdout is null.
stdout_truncatedbooleanrequiredTrue when stdout was cut at the lane's cap.
outcomestringrequiredstdoutstring | nullrequiredStandard output, cut at the lane's cap (default 64 KiB). Null when the output is unavailable: a replayed exec (a retry of a finished command with the same Idempotency-Key, which returns the outcome but not the output, because the platform keeps no output), or a timed-out one in this version. stdout_truncated is false whenever stdout is null.
stdout_truncatedbooleanrequiredTrue when stdout was cut at the lane's cap.
invalid_request: The request does not match the contract. env_name_refused: An env name looks like a secret, which a sandbox may not receive.
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.
sandbox_stopped: The sandbox has stopped: its lifetime or size limit was reached, or it was removed. 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.
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.