---
title: "Import Workloads"
method: POST
path: "/api/v1/deployments/import"
tags: ["deployments"]
---

# Import Workloads

`POST /api/v1/deployments/import`

## Request

- Base URL: `https://api.mengi.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mengi.cloud/api/v1/deployments/import`
- Auth: none declared

Import discovered workloads as Mengi deployments.

Creates Deployment records and pushes values to Git with autoSync=false,
so ArgoCD creates Applications but does not sync them automatically.
Users may only import into imported clusters; the service principal
(worker) may import into any cluster — used after a namespace migration
to adopt the restored workloads. Service-created deployments are owned
by the cluster owner.

## Query parameters

- `cluster_id` string, uuid, required: Cluster ID to import workloads into

## Request body

- WorkloadImportRequest
  - `workloads` WorkloadImportItem[], required
    - `name` string, required
    - `namespace` string, required
    - `kind` string, required
    - `display_name` string, nullable
    - `app_type` 'web_app' | 'api' | 'database' | 'static_site' | 'container' | 'helm'
    - `docker_image` string, nullable
    - `helm_chart_name` string, nullable
    - `helm_chart_version` string, nullable
    - `helm_repo_url` string, nullable
    - `custom_values_yaml` string, nullable
    - `cpu_request` number, nullable
    - `memory_request_mb` integer, nullable
    - `replicas` integer, nullable
    - `container_port` integer, nullable
    - `command` string[], nullable
    - `args` string[], nullable
    - `service_account_name` string, nullable
    - `selector_match_labels` object, nullable
    - `pod_template_labels` object, nullable
    - `manifest_yaml` string, nullable
    - `extra_pod_spec_yaml` string, nullable
    - `extra_container_spec_yaml` string, nullable

## Response `200`

Successful Response

- WorkloadImportResponse
  - `imported` DeploymentResponse[], required
    - `id` string, uuid, required
    - `user_id` string, uuid, required
    - `organization_id` string, uuid, nullable
    - `cluster_id` string, uuid, required
    - `name` string, required
    - `app_type` 'web_app' | 'api' | 'database' | 'static_site' | 'container' | 'helm', required
    - `status` 'pending' | 'provisioning' | 'promoting' | 'running' | 'stopped' | 'failed' | 'error' | 'migrating' | 'deleting', required
    - `config` object, nullable
    - `values_yaml` string, nullable
    - `git_path` string, nullable
    - `endpoint_url` string, nullable
    - `error_message` string, nullable
    - `cpu_request` number, nullable
    - `memory_request_mb` integer, nullable
    - `replicas` integer, nullable
    - `container_port` integer, nullable
    - `storage_size_gb` integer, nullable
    - `command` string[], nullable
    - `args` string[], nullable
    - `deployment_type` string, nullable
    - `helm_repo_url` string, nullable
    - `helm_chart_name` string, nullable
    - `helm_chart_version` string, nullable
    - `custom_values_yaml` string, nullable
    - `image_update_strategy` string, nullable
    - `image_update_constraint` string, nullable
    - `image_allow_tags` string, nullable
    - `image_ignore_tags` string, nullable
    - `is_adopted` boolean
    - `source_namespace` string, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `provider` string, nullable
    - `region` string, nullable
    - `cluster_status` string, nullable
    - `cluster_error` string, nullable
  - `failed` object[], required
  - `total_imported` integer, required
  - `total_failed` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/70dc8775b002?raw)
