> ## 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.

# Start a workspace

> Start a stopped workspace from the config it was created with, over the state it kept; a running one answers as it is.

The server's policies judge the config again, and the secrets and saved entries it names are read again, so a rotated secret is picked up.

> [accordion] Errors
>
> | Status | Meaning |
> | - | - |
> | `400` | Bad request: malformed, a host not allowed, or a browser page from another origin |
> | `401` | The token is missing or wrong |
> | `403` | A policy or mount mode refused the call |
> | `404` | The workspace, session, job or file does not exist |
> | `409` | The id or name is taken, the workspace is busy, or a file changed since it was read |
> | `422` | Validation Error |
> | `429` | Past a rate limit, or a new session past max\_sessions |
> | `503` | The server is at max\_workspaces, or shutting down |
>
> See [error examples and recovery steps](https://docs.mirage.strukto.ai/api/errors.md). The [complete OpenAPI contract](https://github.com/strukto-ai/mirage/blob/main/docs/openapi.yaml) includes every response schema.


## OpenAPI

````yaml /openapi.yaml post /v1/workspaces/{workspace_id}/start
openapi: 3.2.0
info:
  title: Mirage API
  version: '0.1'
servers:
  - url: https://api.strukto.ai
    description: The hosted API
security:
  - bearerAuth: []
tags:
  - name: Workspace operations
    x-group: Workspaces
  - name: Workspaces
    x-group: Lifecycle
    parent: Workspace operations
  - name: Sessions
  - name: Shell
    parent: Workspace operations
  - name: VFS
    parent: Workspace operations
  - name: Tools
  - name: Documents
    parent: Workspace operations
  - name: Snapshots
  - name: Templates
  - name: Saved VFS
    x-group: VFS
    parent: Saved configurations
  - name: Saved CLIs
    x-group: CLIs
    parent: Saved configurations
  - name: Saved runtimes
    x-group: Runtimes
    parent: Saved configurations
  - name: Saved configurations
  - name: Policies
  - name: Asks
    parent: Workspace operations
  - name: Server
  - name: Auth
paths:
  /v1/workspaces/{workspace_id}/start:
    post:
      tags:
        - Workspaces
      summary: Start a workspace
      description: >-
        Start a stopped workspace from the config it was created with, over the
        state it kept; a running one answers as it is.


        The server's policies judge the config again, and the secrets and saved
        entries it names are read again, so a rotated secret is picked up.
      operationId: start_workspace_v1_workspaces__workspace_id__start_post
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceDetail'
      servers:
        - url: http://127.0.0.1:8765
          description: A local daemon on its default port
components:
  parameters:
    workspaceId:
      name: workspace_id
      in: path
      required: true
      description: The workspace's id.
      schema:
        type: string
      example: demo
  schemas:
    WorkspaceDetail:
      properties:
        id:
          title: Id
          type: string
        mode:
          type: string
          title: Mode
        created_at:
          type: number
          title: Created At
          description: >-
            Creation time as Unix seconds. For example, 1794009600 is
            2026-11-07T00:00:00Z. Fractional values include sub-second
            precision.
          example: 1794009600
        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
  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.