Deployment status
A create request returns once the sandbox isDEPLOYED. Check status later
with Get a sandbox, or on the sandbox’s
detail page in the dashboard.
DEPLOYING: deployment is in progress.DEPLOYED: the sandbox is ready.DEACTIVATING: the sandbox is going idle.DEACTIVATED: the sandbox is on standby. Its files and processes persist, and the next request resumes it.FAILED: deployment failed.DELETING: deletion is in progress.TERMINATED: deletion has completed.
DEPLOYED means the environment is ready, not that a task succeeded. Confirm
a task by its command’s exit status and output.
Deletion is asynchronous. A delete request returns DELETING. Repeat the get
request until the status is TERMINATED or the sandbox is no longer found.
Expiration policy
An expiration policy automatically deletes a sandbox. By default, sandboxes expire 7 days after creation. Select a policy type to control when the sandbox expires:TTL_MAX_AGE: a duration after creation. Activity doesn’t extend it.TTL_IDLE: a duration without activity.DATE: a specific timestamp.
TTL_MAX_AGE; the CLI has no expiration flag.
To change a policy, use an SDK or the
update request’s lifecycle field.
Include every policy you want to keep: the new list replaces the previous one
and can’t be empty. TTL_MAX_AGE always counts from creation.
Create a sandbox with a lifetime of 1 hour
Create a sandbox with a lifetime of 1 hour
Set up your SDK and API key before running an SDK
example.Get the sandbox to confirm its policy.
The API’s
- TypeScript
- Python
- Go
- API
Set
afterMs in milliseconds.To create a sandbox with a lifetime of 1 hour:Run the following code:expires_in field shows the remaining lifetime in seconds.
Delete the sandbox when you’re finished.