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

# Import Workspace Config

> Import workspace configuration from YAML.

This endpoint creates agents, MCP instances, and provider configs
in the current workspace based on the provided YAML configuration.

**Important Notes:**
- All resources are created in the current workspace
- Secrets (API keys, passwords) must be provided as they cannot be exported
- References to MCP servers and provider specs must exist in the system
- Import is atomic - if any resource fails, all changes are rolled back

**Example YAML:**
```yaml
agents:
  - name: "My Assistant"
    description: "Helpful assistant"
    instruction: "You are a helpful AI assistant"
    tools:
      - type: code
        name: agentarea/math
      - type: mcp
        name: my-filesystem
        settings:
          allowed_tools: [read_file, write_file]
    planning: false

mcp_instances:
  - name: "My Filesystem"
    description: "Local file access"
    server_spec_id: "a1b2c3d4-..."
    env_vars:
      FILESYSTEM_ROOT: "/workspace"

provider_configs:
  - name: "My OpenAI"
    provider_spec_id: "932f3839-..."
    api_key_placeholder: "sk-..."
```



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspace/import
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/workspace/import:
    post:
      tags:
        - v1
        - protected
        - workspace-config
      summary: Import Workspace Config
      description: >-
        Import workspace configuration from YAML.


        This endpoint creates agents, MCP instances, and provider configs

        in the current workspace based on the provided YAML configuration.


        **Important Notes:**

        - All resources are created in the current workspace

        - Secrets (API keys, passwords) must be provided as they cannot be
        exported

        - References to MCP servers and provider specs must exist in the system

        - Import is atomic - if any resource fails, all changes are rolled back


        **Example YAML:**

        ```yaml

        agents:
          - name: "My Assistant"
            description: "Helpful assistant"
            instruction: "You are a helpful AI assistant"
            tools:
              - type: code
                name: agentarea/math
              - type: mcp
                name: my-filesystem
                settings:
                  allowed_tools: [read_file, write_file]
            planning: false

        mcp_instances:
          - name: "My Filesystem"
            description: "Local file access"
            server_spec_id: "a1b2c3d4-..."
            env_vars:
              FILESYSTEM_ROOT: "/workspace"

        provider_configs:
          - name: "My OpenAI"
            provider_spec_id: "932f3839-..."
            api_key_placeholder: "sk-..."
        ```
      operationId: import_workspace_config_v1_workspace_import_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ImportRequest:
      description: Request body for importing workspace configuration.
      properties:
        override_existing:
          default: false
          description: Override existing resources with same name
          title: Override Existing
          type: boolean
        skip_missing_dependencies:
          default: false
          description: Skip resources with missing dependencies
          title: Skip Missing Dependencies
          type: boolean
        yaml_content:
          description: YAML configuration content
          title: Yaml Content
          type: string
      required:
        - yaml_content
      title: ImportRequest
      type: object
    ImportResult:
      description: Result of an import operation.
      properties:
        created_agents:
          default: 0
          title: Created Agents
          type: integer
        created_mcp_instances:
          default: 0
          title: Created Mcp Instances
          type: integer
        created_provider_configs:
          default: 0
          title: Created Provider Configs
          type: integer
        created_skills:
          default: 0
          title: Created Skills
          type: integer
        errors:
          items:
            type: string
          title: Errors
          type: array
        success:
          title: Success
          type: boolean
        warnings:
          items:
            type: string
          title: Warnings
          type: array
      required:
        - success
      title: ImportResult
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````