Docs
Sandboxes ›

Get sandbox auto stop

GET/v1/sandboxes/{id}/auto-stop

When a running sandbox is to be stopped, how long that is from now, and what decided it.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const stop = await sandbox.autoStop();
Answer200 OK · SandboxAutoStop
  1. {
  2. "sandboxId": string,
  3. "status": "creating" | "running" | "stopped" | "error" | "deleted" | "restoring" | …,
  4. "autoStopAt": string | null,
  5. "secondsLeft": integer | null,
  6. "ttlSeconds": integer | null,
  7. "setBy": "ttl" | "account" | "sandbox" | "null" | null,
  8. }

When it is to be stopped.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 When it is to be stopped.

SandboxAutoStop6 fields
sandboxId
string
status
creatingrunningstoppederrordeletedrestoringmigrating
autoStopAt
stringnull
When the sandbox is to be stopped.
More Null when it is not running, or has no time limit.
secondsLeft
integernull
Seconds from now until then.
More Null with autoStopAt.
ttlSeconds
integernull
Seconds each start runs before it is stopped, unless the stop is moved.
More Null is the deployment's default.
setBy
ttlaccountsandboxnullnull
What decided autoStopAt.
More ttl: its last start and ttlSeconds. account: a PUT of this with one of its account's API keys, or the console. sandbox: a PUT of this by the sandbox itself. Null with autoStopAt.

Errors and other answers

404 Not found.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.