> ## 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: >-
            Permit this connect to start the workspace. Omitted or false
            attaches only: a workspace that is not already usable answers 409
            with the conflict union, discriminated by kind.
          explode: false
          in: query
          name: start
          schema:
            description: >-
              Permit this connect to start the workspace. Omitted or false
              attaches only: a workspace that is not already usable answers 409
              with the conflict union, discriminated by kind.
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                discriminator:
                  mapping:
                    connecting: '#/components/schemas/ConnectWorkspaceConnecting'
                    running: '#/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
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/WorkspaceConnectConflictResponse'
                  - $ref: '#/components/schemas/TaskCreatorDeletedErrorResponse'
          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
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    ConnectWorkspaceConnecting:
      additionalProperties: false
      properties:
        display_state:
          enum:
            - deleted
            - idle
            - starting
            - stopping
            - suspending
            - 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
            - 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
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
      type: object
    WorkspaceRuntimeAdmissionError:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
        org_id:
          format: uuid
          type: string
        tier:
          type: string
        vm_size:
          type: string
      required:
        - error
        - code
        - tier
        - vm_size
        - org_id
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    WorkspaceConnectConflictResponse:
      discriminator:
        mapping:
          not_connectable: '#/components/schemas/WorkspaceConnectConflictNotConnectable'
          startable: '#/components/schemas/WorkspaceConnectConflictStartable'
          transitional: '#/components/schemas/WorkspaceConnectConflictTransitional'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/WorkspaceConnectConflictTransitional'
        - $ref: '#/components/schemas/WorkspaceConnectConflictStartable'
        - $ref: '#/components/schemas/WorkspaceConnectConflictNotConnectable'
    TaskCreatorDeletedErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - task_creator_deleted
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      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:
            - start
            - suspend
            - stop
            - 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
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    WorkspaceConnectConflictNotConnectable:
      additionalProperties: false
      properties:
        display_state:
          enum:
            - deleted
            - idle
            - error
            - stopped
            - suspended
          type: string
        error:
          minLength: 1
          type: string
        kind:
          enum:
            - not_connectable
          type: string
        workspace_id:
          format: uuid
          type: string
      required:
        - kind
        - error
        - workspace_id
        - display_state
      type: object
    WorkspaceConnectConflictStartable:
      additionalProperties: false
      properties:
        error:
          minLength: 1
          type: string
        kind:
          enum:
            - startable
          type: string
        workspace_id:
          format: uuid
          type: string
      required:
        - kind
        - error
        - workspace_id
      type: object
    WorkspaceConnectConflictTransitional:
      additionalProperties: false
      properties:
        error:
          minLength: 1
          type: string
        kind:
          enum:
            - transitional
          type: string
        retry_after_ms:
          format: int64
          minimum: 1
          type: integer
        workspace_id:
          format: uuid
          type: string
      required:
        - kind
        - error
        - workspace_id
        - retry_after_ms
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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