> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepest.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Sandbox idle policy

> Set idle_timeout_seconds or omit the field to disable idle auto-stop. Changing idle policy counts as current interaction but never changes the fixed 24-hour expires_at.



## OpenAPI

````yaml /openapi.json post /v1/sandboxes/{sandbox_id}/idle
openapi: 3.0.3
info:
  title: Deepest Core V1
  version: 0.4.0
  description: >-
    Deepest provides persistent Linux Computers and temporary Sandboxes that
    share Account resources. Create and Resize select Memory; CPU is shared
    across the Account, and Storage covers retained data and snapshots. A
    verified Human session and an Agent API Key access the same Account through
    this API. Signing in alone grants no compute entitlement. Only Human
    sessions can manage Agent API Keys, redeem Invites, or confirm human
    assistance. The operations below cover Machine lifecycle, commands, Tools,
    SSH, Private Preview, Share, Desktop, human assistance, resources and Vault
    Secrets.
servers:
  - url: https://console.deepest.dev
    description: >-
      Hosted Deepest Control API (use your configured control origin for custom
      deployments)
security:
  - accountKey: []
  - clerkSession: []
tags:
  - name: Account Resources
    x-displayName: Account & Resources
    description: >-
      Observe Account entitlement, Memory, shared CPU, Storage, Machine counts,
      and network policy.
  - name: Invitations
    description: Redeem human-session Beta invitations to activate Account entitlement.
  - name: Agent Keys
    description: Create, list, and revoke Account-wide Agent API Keys from a Human session.
  - name: Computers
    description: >-
      Create, observe, start, stop, resize, clone, run commands on, and delete
      persistent Linux Computers.
  - name: Snapshots and Storage
    x-displayName: Snapshots & Storage
    description: >-
      Create, inspect, restore, and delete disk-only Computer snapshots, and
      reclaim reusable storage.
  - name: SSH
    description: Manage per-Computer SSH public keys and retrieve the current SSH endpoint.
  - name: Preview and Share
    x-displayName: Preview & Share
    description: >-
      Expose Guest HTTP/WebSocket ports via Private Preview or 24-hour anonymous
      Share links.
  - name: Desktop and Assistance
    x-displayName: Desktop & Assistance
    description: >-
      Prepare and open a Computer Desktop Viewer and coordinate cooperative
      human assistance.
  - name: Agent Tools
    description: >-
      Read the tools catalog and inspect or install supported Coding Agents on a
      Computer.
  - name: Sandboxes
    description: >-
      Manage temporary 24-hour headless Sandboxes, command execution, and idle
      auto-stop policy.
  - name: Vault and Secrets
    x-displayName: Vault & Secrets
    description: >-
      Store encrypted Account Secrets and grant or revoke exact-host HTTPS
      substitution per Machine.
paths:
  /v1/sandboxes/{sandbox_id}/idle:
    post:
      tags:
        - Sandboxes
      summary: Set Sandbox idle policy
      description: >-
        Set idle_timeout_seconds or omit the field to disable idle auto-stop.
        Changing idle policy counts as current interaction but never changes the
        fixed 24-hour expires_at.
      operationId: sandboxesIdle
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxIdleInput'
      responses:
        '200':
          description: Current Sandbox policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxResult'
        default:
          description: Machine-readable failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Failure'
components:
  schemas:
    SandboxIdleInput:
      type: object
      additionalProperties: false
      properties:
        idle_timeout_seconds:
          type: integer
          format: uint32
          minimum: 60
          maximum: 86400
      description: >-
        Set idle_timeout_seconds, or omit the field to disable idle auto-stop.
        This never changes hard TTL.
    SandboxResult:
      type: object
      additionalProperties: false
      required:
        - ok
        - resource_id
        - retry
        - result
      properties:
        ok:
          type: boolean
          enum:
            - true
        resource_id:
          type: string
        retry:
          type: string
          enum:
            - safe
        result:
          $ref: '#/components/schemas/Sandbox'
    Failure:
      type: object
      additionalProperties: false
      required:
        - ok
        - resource_id
        - retry
        - error
      properties:
        ok:
          type: boolean
          enum:
            - false
        resource_id:
          type: string
        retry:
          $ref: '#/components/schemas/Retry'
        error:
          $ref: '#/components/schemas/ErrorBody'
    Sandbox:
      type: object
      additionalProperties: false
      required:
        - id
        - ram_mib
        - state
        - expires_at
        - stop_reason
      properties:
        id:
          type: string
        ram_mib:
          type: integer
          format: uint32
          minimum: 1
          maximum: 4294967295
        state:
          $ref: '#/components/schemas/ComputerState'
        expires_at:
          type: integer
          format: uint64
          description: >-
            Absolute Unix epoch milliseconds. touch, Start, Stop and idle-policy
            changes never modify it.
        idle_timeout_seconds:
          type: integer
          format: uint32
          minimum: 60
          maximum: 86400
          description: >-
            Current idle auto-stop timeout. Omitted means idle auto-stop is
            disabled.
        stop_reason:
          $ref: '#/components/schemas/SandboxStopReason'
      description: >-
        Short-lived Headless Machine sharing the Account resource pool with
        Computers.
    Retry:
      type: string
      enum:
        - safe
        - query-first
        - no-retry
      description: >-
        safe permits an explicit retry; query-first requires observation of the
        original resource before any new mutation; no-retry requires a changed
        request or corrected cause. The SDK never retries automatically.
    ErrorBody:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
        details:
          $ref: '#/components/schemas/ToolOutcome'
        retry_after_seconds:
          type: integer
          minimum: 1
          description: >-
            Backoff in seconds, equal to the Retry-After header on HTTP 429
            errors such as EXEC_BUSY, LIFECYCLE_BUSY or RATE_LIMITED. No action
            was dispatched.
        limit:
          $ref: '#/components/schemas/LimitReason'
    ComputerState:
      type: string
      enum:
        - running
        - stopped
        - starting
        - paused
        - draining
        - unknown
      description: >-
        Current observed Computer state. Starting, Running, Paused and Draining
        retain Memory until release is confirmed. An unconfirmed lifecycle
        action returns UNKNOWN/query-first; unknown is never evidence of Stopped
        or released resources.
    SandboxStopReason:
      type: string
      enum:
        - none
        - user
        - idle
        - entitlement
      description: >-
        Why the current stopped Sandbox was stopped. none is used while running
        or before any stop; hard TTL deletes the Sandbox instead of adding an
        expired state.
    ErrorCode:
      type: string
      enum:
        - UNAUTHORIZED
        - AUTH_UNAVAILABLE
        - NOT_FOUND
        - INVALID_REQUEST
        - LIMIT_EXCEEDED
        - ENTITLEMENT_REQUIRED
        - ENTITLEMENT_PENDING
        - INVITE_UNAVAILABLE
        - SANDBOX_NOT_ENABLED
        - IDEMPOTENCY_CONFLICT
        - NOT_RUNNING
        - EXEC_BUSY
        - LIFECYCLE_BUSY
        - RATE_LIMITED
        - EXEC_FAILED
        - UNKNOWN
        - RUNTIME_UNAVAILABLE
        - INTERNAL
        - TOOL_NOT_SUPPORTED
        - TOOL_FAILED
        - PREVIEW_UNAVAILABLE
        - DESKTOP_UNAVAILABLE
        - DESKTOP_UNSUPPORTED
        - STORAGE_LIMIT_EXCEEDED
        - STOPPED_REQUIRED
        - RESIZE_UNSUPPORTED
        - RESOURCE_CONFLICT
        - STORAGE_RECLAIM_UNSUPPORTED
        - STORAGE_RECLAIM_INSUFFICIENT_SPACE
        - STORAGE_RECLAIM_FAILED
        - VAULT_UNAVAILABLE
      description: >-
        Stable public errors. UNKNOWN (control API HTTP 502, query-first)
        requires checking the original resource or command effect before another
        mutation. EXEC_BUSY (HTTP 429, safe) means the Account command capacity
        was unavailable before dispatch. LIFECYCLE_BUSY (HTTP 429, safe) means
        the lifecycle action was rejected before dispatch. RATE_LIMITED (HTTP
        429, safe) means a bounded public/Human action was rejected before
        lookup or mutation; wait before another explicit attempt. Wait at least
        the Retry-After header or its equal JSON field error.retry_after_seconds
        before retrying any HTTP 429 error. If the original intent is still
        needed, retry explicitly with the same request and, when present, the
        original idempotency key. SANDBOX_NOT_ENABLED means the Account
        entitlement does not permit Sandbox creation and is not ordinary Memory
        pressure. AUTH_UNAVAILABLE (HTTP 503, safe) means a Clerk Human session
        could not be checked and no product action was dispatched.
        STORAGE_LIMIT_EXCEEDED rejects growth while Product used >= limit;
        original Start remains allowed subject to Account eligibility and
        available capacity. STOPPED_REQUIRED requires an explicit normal Stop.
        RESIZE_UNSUPPORTED means that Memory change is not supported for the
        Computer. RESOURCE_CONFLICT (HTTP 409, no-retry) means an observed
        dependency prevents completion; resolve the reported cause before
        another explicit attempt. It is distinct from an UNKNOWN physical
        outcome. ENTITLEMENT_REQUIRED (403, no-retry) means there is no active
        entitlement; read resources.get. ENTITLEMENT_PENDING (409, safe) means
        previous expiry or cleanup must settle before redemption.
        INVITE_UNAVAILABLE (404, no-retry) intentionally does not distinguish
        invalid, revoked, exhausted or already-used codes. VAULT_UNAVAILABLE
        (HTTP 503, no-retry) means Vault is unavailable; contact support before
        attempting further Secret changes.
    ToolOutcome:
      type: object
      additionalProperties: false
      required:
        - tool_id
        - status
        - reason
        - version
        - launch
      properties:
        tool_id:
          type: string
        status:
          $ref: '#/components/schemas/ToolStatus'
        reason:
          $ref: '#/components/schemas/ToolReason'
        version:
          type: string
        launch:
          type: string
    LimitReason:
      type: object
      additionalProperties: false
      required:
        - dimension
        - scope
      properties:
        dimension:
          $ref: '#/components/schemas/LimitDimension'
        scope:
          $ref: '#/components/schemas/LimitScope'
      description: >-
        The limit that rejected the action with LIMIT_EXCEEDED (HTTP 409,
        no-retry).
    ToolStatus:
      type: string
      enum:
        - success
        - existing
        - absent
        - failed
        - unknown
      description: >-
        success means this install verified a command; existing means a command
        or protected installation path already exists and was not overwritten;
        absent is a successful inspection with nothing installed; failed and
        unknown use non-2xx error envelopes.
    ToolReason:
      type: string
      enum:
        - verified
        - command_exists
        - files_exist
        - unsupported_platform
        - prerequisites_missing
        - download_failed
        - installer_failed
        - verification_failed
        - in_progress
        - untrusted_result
      description: Machine-readable reason returned by the Tool installation or inspection.
    LimitDimension:
      type: string
      enum:
        - memory
        - persistent_computers
        - reserved_intents
        - share_records
        - secret_grants
      description: >-
        memory covers the Account's configured Memory and shared-pool admission.
        persistent_computers counts retained persistent Computer products for
        the Account, including stopped/reserved/pending Computers until Delete
        removes the product record; Sandboxes are separate. reserved_intents
        counts accepted Computer, Sandbox and Snapshot creation requests not yet
        started. share_records counts retained Account Share entries, including
        revoked and expired entries until removal. secret_grants counts saved
        grants on the target Machine.
    LimitScope:
      type: string
      enum:
        - account
        - machine
      description: The scope in which the limit was enforced.
  securitySchemes:
    accountKey:
      type: http
      scheme: bearer
      description: >-
        A Deepest Account-scoped Agent API Key issued by the signed-in owner.
        Never put the key in a URL or Guest environment.
    clerkSession:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Current Clerk browser session token issued for the configured control
        origin. Accepted only when Clerk is enabled; not interchangeable with a
        Deepest Agent API Key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.