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

# Load a snapshot



## OpenAPI

````yaml /openapi.yaml post /v1/workspaces/load
openapi: 3.1.0
info:
  title: Mirage API
  version: '0.1'
servers:
  - url: http://127.0.0.1:8765
    description: A local daemon on its default port
security:
  - bearerAuth: []
paths:
  /v1/workspaces/load:
    post:
      tags:
        - Snapshots
      summary: Load a snapshot
      operationId: load_workspace_v1_workspaces_load_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadRequest'
          multipart/form-data:
            schema:
              type: object
              properties:
                request:
                  $ref: '#/components/schemas/LoadRequest'
                snapshot:
                  type: string
                  format: binary
                  description: The tar archive, up to 1 GiB.
              required:
                - snapshot
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceDetail'
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
components:
  schemas:
    LoadRequest:
      type: object
      properties:
        key:
          type: string
          description: The tar's key in the snapshot store; leave it out when uploading.
        id:
          type: string
          description: The new workspace's id.
        override:
          type: object
          description: >-
            Configuration overrides for the restored workspace, including
            credentials redacted from the snapshot.
    WorkspaceDetail:
      properties:
        id:
          type: string
          title: Id
        mode:
          type: string
          title: Mode
        created_at:
          type: number
          title: Created At
        fuse_mountpoints:
          additionalProperties:
            type: string
          type: object
          title: Fuse Mountpoints
        system_time:
          anyOf:
            - type: string
            - type: 'null'
          title: System Time
        sessions:
          items:
            $ref: '#/components/schemas/SessionSummary'
          type: array
          title: Sessions
        mounts:
          items:
            $ref: '#/components/schemas/MountSummary'
          type: array
          title: Mounts
        internals:
          anyOf:
            - $ref: '#/components/schemas/WorkspaceInternals'
            - type: 'null'
      type: object
      required:
        - id
        - mode
        - created_at
      title: WorkspaceDetail
    SessionSummary:
      properties:
        session_id:
          type: string
          title: Session Id
        cwd:
          type: string
          title: Cwd
      type: object
      required:
        - session_id
        - cwd
      title: SessionSummary
    MountSummary:
      properties:
        prefix:
          type: string
          title: Prefix
        vfs:
          type: string
          title: Vfs
        mode:
          type: string
          title: Mode
        description:
          type: string
          title: Description
          default: ''
      type: object
      required:
        - prefix
        - vfs
        - mode
      title: MountSummary
    WorkspaceInternals:
      properties:
        cache_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Bytes
        cache_entries:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Entries
        history_length:
          type: integer
          title: History Length
        in_flight_jobs:
          type: integer
          title: In Flight Jobs
      type: object
      required:
        - cache_bytes
        - cache_entries
        - history_length
        - in_flight_jobs
      title: WorkspaceInternals
    Error:
      type: object
      properties:
        detail:
          description: What went wrong, as text or a structured record.
        errno:
          type: string
          description: The errno of a failed file call, such as ENOENT.
        refusal:
          type: object
          description: The policy refusal, when a policy refused the call.
      required:
        - detail
  responses:
    '401':
      description: The token is missing or wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
        text/plain:
          schema:
            type: string
            description: The Python daemon answers Unauthorized as plain text.
    '409':
      description: >-
        The id or name is taken, the workspace is busy, or a file changed since
        it was read
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Past a rate limit, or a new session past max_sessions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default
        local mode with no token accepts requests without one.

````

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