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

# Connect to a workspace



## OpenAPI

````yaml api-reference/openapi.v1.json POST /workspaces/{workspaceID}/connect
openapi: 3.1.0
info:
  title: Aether Public API
  version: 0.1.0
  description: >-
    The versioned, public Aether REST API. Authenticate with an `aether_`
    platform API key or a session token.
servers:
  - url: https://api.runaether.dev/v1
security:
  - bearerAuth: []
paths:
  /workspaces/{workspaceID}/connect:
    post:
      tags:
        - workspaces
      summary: Connect to a workspace
      operationId: connectWorkspace
      parameters:
        - in: path
          name: workspaceID
          required: true
          schema:
            format: uuid
            type: string
        - description: >-
            Task to attribute a workspace start to when connecting has to start
            the workspace.
          explode: false
          in: query
          name: task_id
          schema:
            description: >-
              Task to attribute a workspace start to when connecting has to
              start the workspace.
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                discriminator:
                  mapping:
                    connecting:
                      $ref: '#/components/schemas/ConnectWorkspaceConnecting'
                    running:
                      $ref: '#/components/schemas/ConnectWorkspaceRunning'
                  propertyName: state
                oneOf:
                  - $ref: '#/components/schemas/ConnectWorkspaceRunning'
                  - $ref: '#/components/schemas/ConnectWorkspaceConnecting'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceRuntimeAdmissionError'
          description: Payment Required
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceConnectConflictResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    ConnectWorkspaceConnecting:
      additionalProperties: false
      properties:
        display_state:
          enum:
            - deleted
            - idle
            - starting
            - stopping
            - suspending
            - destroying
            - ready
            - preparing
            - error
            - stopped
            - suspended
          type: string
        last_started_at:
          minLength: 1
          type: string
        operation:
          $ref: '#/components/schemas/WorkspaceOperationSummary'
        retry_after_ms:
          format: int64
          minimum: 1
          type: integer
        state:
          enum:
            - connecting
          type: string
        workspace_id:
          format: uuid
          type: string
      required:
        - workspace_id
        - state
        - display_state
        - retry_after_ms
      type: object
    ConnectWorkspaceRunning:
      additionalProperties: false
      properties:
        display_state:
          enum:
            - deleted
            - idle
            - starting
            - stopping
            - suspending
            - destroying
            - ready
            - preparing
            - error
            - stopped
            - suspended
          type: string
        last_started_at:
          minLength: 1
          type: string
        operation:
          $ref: '#/components/schemas/WorkspaceOperationSummary'
        state:
          enum:
            - running
          type: string
        transport:
          $ref: '#/components/schemas/WorkspaceConnectTransport'
        workspace_id:
          format: uuid
          type: string
      required:
        - workspace_id
        - state
        - display_state
        - transport
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
      type: object
    WorkspaceRuntimeAdmissionError:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
        tier:
          type: string
        vm_size:
          type: string
      required:
        - error
        - code
        - tier
        - vm_size
      type: object
    WorkspaceConnectConflictResponse:
      additionalProperties: false
      properties:
        display_state:
          enum:
            - deleted
            - idle
            - starting
            - stopping
            - suspending
            - destroying
            - ready
            - preparing
            - error
            - stopped
            - suspended
          type: string
        error:
          minLength: 1
          type: string
        workspace_id:
          format: uuid
          type: string
      required:
        - error
        - workspace_id
        - display_state
      type: object
    WorkspaceOperationSummary:
      additionalProperties: false
      properties:
        completed_at:
          minLength: 1
          type: string
        created_at:
          minLength: 1
          type: string
        error_message:
          minLength: 1
          type: string
        id:
          format: uuid
          type: string
        status:
          enum:
            - queued
            - running
            - reconciling
            - succeeded
            - failed
            - cancelled
          type: string
        type:
          enum:
            - create
            - start
            - suspend
            - stop
            - destroy
            - recover
          type: string
        updated_at:
          minLength: 1
          type: string
      required:
        - id
        - type
        - status
        - created_at
        - updated_at
      type: object
    WorkspaceConnectTransport:
      additionalProperties: false
      properties:
        preview_token:
          maxLength: 32
          minLength: 32
          pattern: ^[a-z0-9]{32}$
          type: string
        websocket_path:
          minLength: 1
          type: string
      required:
        - websocket_path
        - preview_token
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````