> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Workspaces

> Append workspaces to the saved list. Idempotent — dedupes by ``path``.



## OpenAPI

````yaml /openapi/agent-sdk.json post /api/workspaces
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/workspaces:
    post:
      tags:
        - Workspaces
      summary: Add Workspaces
      description: Append workspaces to the saved list. Idempotent — dedupes by ``path``.
      operationId: add_workspaces_api_workspaces_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddWorkspacesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspacesListResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    AddWorkspacesRequest:
      properties:
        workspaces:
          items:
            $ref: '#/components/schemas/WorkspaceItem'
          title: Workspaces
          type: array
      required:
        - workspaces
      title: AddWorkspacesRequest
      type: object
    WorkspacesListResponse:
      properties:
        workspaceParents:
          items:
            $ref: '#/components/schemas/WorkspaceParentItem'
          title: Workspaceparents
          type: array
        workspaces:
          items:
            $ref: '#/components/schemas/WorkspaceItem'
          title: Workspaces
          type: array
      title: WorkspacesListResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    WorkspaceItem:
      properties:
        id:
          maxLength: 4096
          minLength: 1
          title: Id
          type: string
        name:
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        parentPath:
          anyOf:
            - maxLength: 4096
              type: string
            - type: 'null'
          title: Parentpath
        path:
          maxLength: 4096
          minLength: 1
          title: Path
          type: string
      required:
        - id
        - name
        - path
      title: WorkspaceItem
      type: object
    WorkspaceParentItem:
      properties:
        id:
          maxLength: 4096
          minLength: 1
          title: Id
          type: string
        name:
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        path:
          maxLength: 4096
          minLength: 1
          title: Path
          type: string
      required:
        - id
        - name
        - path
      title: WorkspaceParentItem
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

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