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

# Upgrade the sandbox-api

> Triggers an upgrade of the sandbox-api process. Returns 200 immediately before upgrading.
The upgrade will: download the specified binary from GitHub releases, validate it, and restart.
All running processes will be preserved across the upgrade.
Available versions: "develop" (default), "main", "latest", or specific tag like "v1.0.0"
You can also specify a custom baseUrl for forks (defaults to https://github.com/blaxel-ai/sandbox/releases)



## OpenAPI

````yaml https://raw.githubusercontent.com/blaxel-ai/sandbox/refs/heads/main/sandbox-api/docs/openapi.yml post /upgrade
openapi: 3.0.0
info:
  contact: {}
  description: API for manipulating filesystem, processes and network.
  title: Sandbox API
  version: 0.0.1
servers:
  - url: https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run
    variables:
      sandbox_id:
        default: unknown
      workspace_id:
        default: unknown
      region:
        default: unknown
security:
  - BearerAuth: []
paths:
  /upgrade:
    post:
      tags:
        - system
      summary: Upgrade the sandbox-api
      description: >-
        Triggers an upgrade of the sandbox-api process. Returns 200 immediately
        before upgrading.

        The upgrade will: download the specified binary from GitHub releases,
        validate it, and restart.

        All running processes will be preserved across the upgrade.

        Available versions: "develop" (default), "main", "latest", or specific
        tag like "v1.0.0"

        You can also specify a custom baseUrl for forks (defaults to
        https://github.com/blaxel-ai/sandbox/releases)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpgradeRequest'
        description: Upgrade options
      responses:
        '200':
          description: Upgrade initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UpgradeRequest:
      properties:
        baseUrl:
          description: Base URL for releases (useful for forks)
          example: https://github.com/blaxel-ai/sandbox/releases
          type: string
        version:
          description: >-
            Version to upgrade to: "develop", "main", "latest", or specific tag
            like "v1.0.0"
          example: develop
          type: string
      type: object
    SuccessResponse:
      properties:
        message:
          example: File created successfully
          type: string
        path:
          example: /path/to/file
          type: string
      required:
        - message
      type: object
    ErrorResponse:
      properties:
        error:
          example: Error message
          type: string
      required:
        - error
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````