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

# Download a snapshot

> Streams a tar of each saved file and folder of a snapshot. The names in the tar have no leading /. A snapshot holds the saved files: the files and folders that are different from the base image. It works with no running sandbox, also after the sandbox is deleted, until its saved files are deleted. Needs the `snapshots:read` scope.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/snapshots/{id}/download
openapi: 3.1.0
info:
  title: VMS API
  version: 1.0.0
  description: >-
    The public API of a VMS workspace. Each request needs an API key of the
    workspace in the Authorization header.
servers:
  - url: https://vms.dev/api
    description: The VMS API
security:
  - apiKey: []
paths:
  /v1/snapshots/{id}/download:
    get:
      tags:
        - Snapshots
      summary: Download a snapshot
      description: >-
        Streams a tar of each saved file and folder of a snapshot. The names in
        the tar have no leading /. A snapshot holds the saved files: the files
        and folders that are different from the base image. It works with no
        running sandbox, also after the sandbox is deleted, until its saved
        files are deleted. Needs the `snapshots:read` scope.
      operationId: downloadSnapshot
      parameters:
        - in: path
          name: id
          schema:
            type: string
            description: The ID of the snapshot.
            example: snp_06d8k3m7q2v9x4b1n5c0e8f2ja
          required: true
          description: The ID of the snapshot.
      responses:
        '200':
          description: A tar of the snapshot.
          content:
            application/x-tar:
              schema:
                type: string
                format: binary
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The API key is missing, not correct, revoked, or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The API key does not have the scope of the endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            The workspace has no snapshot with this ID, or the snapshot has no
            saved file or folder at this path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The snapshot uses an old format (`snapshot_old_format`). Resume the
            sandbox to read its files.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            The API key sent more than 1,200 requests in one minute, or too many
            snapshot reads are open. Wait `retryAfterSeconds`, then try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Could not read the snapshot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: no_capacity
            message:
              type: string
            requestId:
              type:
                - string
                - 'null'
            retryAfterSeconds:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            sandboxId:
              description: The sandbox that the error is about.
              type: string
          required:
            - code
            - message
            - requestId
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key that starts with vms_. Make one in Settings > API keys.

````

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