---
title: "Import Workspace Config"
method: POST
path: "/v1/workspace/import"
tags: ["v1", "protected", "workspace-config"]
---

# Import Workspace Config

`POST /v1/workspace/import`

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-..."
```

## Request body

- ImportRequest — Request body for importing workspace configuration.
  - `override_existing` boolean — Override existing resources with same name
  - `skip_missing_dependencies` boolean — Skip resources with missing dependencies
  - `yaml_content` string, required — YAML configuration content

## Response `200`

Successful Response

- ImportResult — Result of an import operation.
  - `created_agents` integer
  - `created_mcp_instances` integer
  - `created_provider_configs` integer
  - `created_skills` integer
  - `errors` string[]
  - `success` boolean, required
  - `warnings` string[]

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agentarea/apis/agentarea-api.md) · [All operations](https://skmtc.net/agentarea/apis/agentarea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agentarea/agentarea-api/versions/e3650e48373b/schema)
