Skip to main content
Each sandbox stops on its own 1 hour after its start. Set a different time at create, extend it later, or turn it off.

Write the code that sets the auto-stop of a sandbox.

Before you start

How the auto-stop works

Each sandbox has two fields: At stopAt, the sandbox stops with a normal stop. The pre-stop script runs, the sandbox saves its files, and the host keeps its memory for 10 minutes. GET /v1/sandboxes/{id} shows the stop in operation, as for a stop that you send. See Stop a sandbox. Each resume sets a new stopAt: the time of the resume plus stopAfterSeconds.

Set the auto-stop at create

Send stopAfterSeconds with the create, from 60 to 2592000 (30 days):
The response shows the time in stopAt:
To give a time, send stopAt in place of stopAfterSeconds, for example "stopAt": "2026-11-16T18:00:00Z". The time must be in the future and within 30 days. Do not send stopAt and stopAfterSeconds in one request. The API answers 400.

Extend the auto-stop

Send PATCH /v1/sandboxes/{id} with a new stopAfterSeconds:
The API answers 200 with the sandbox.
  • The new time counts from the current start of the sandbox, not from the request. If the sandbox already ran for longer, it stops now.
  • A stopAt in the PATCH body sets the time of the next auto-stop. You can send stopAt only when the sandbox is creating, starting, or running. For other states, the API answers 409.
  • A stopAfterSeconds for a stopped sandbox applies at the next resume.

Turn off the auto-stop

Send null in stopAfterSeconds or in stopAt, at create or with PATCH /v1/sandboxes/{id}:
Then stopAt and stopAfterSeconds are null, and the sandbox runs until you stop it.

Limits of the trial

In the trial, a sandbox stops on its own within 4 hours of its start. autoStopSeconds in GET /v1/limits shows this limit. A stopAfterSeconds above 14400, a stopAt more than 4 hours after the start, and null answer 400. Each paid plan has no limit. See Trial.