> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.icepanel.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.icepanel.io/_mcp/server.

# Import

POST https://api.icepanel.io/v1/landscapes/{landscapeId}/versions/{versionId}/import
Content-Type: application/json

Create a background job that imports a landscape from JSON format.

The `JSONSchema` can be accessed at `api.icepanel.io/v1/schemas/LandscapeImportData` for automations or using LLMs for generation.

Reference: https://developer.icepanel.io/api-reference/landscapes/import/create

## Authentication

- `X-API-Key` header (required) — API key authentication
- `Authorization` header (bearer token, required) — Bearer token authentication

## Request

### Path parameters

- `landscapeId` (string, required)
- `versionId` (string, required)

### Query parameters

- `prune` (boolean, optional) — When enabled, entities that are missing from the import will be deleted.

### Body (application/json)

This endpoint expects a LandscapeImportData.

- `modelConnections` (list of ModelConnectionImport, optional)
- `modelObjects` (list of ModelObjectImport, optional)
- `namespace` (string, optional) — The namespace of the import, used for seperate operations when using multiple import sources
- `tagGroups` (list of TagGroupImport, optional)
- `tags` (list of TagImport, optional)

## Response

### 200

OK

- `landscapeImport` (LandscapeImport, required)

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 401 Unauthorized Error

Unauthorized

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 403 Forbidden Error

Forbidden

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 404 Not Found Error

Not Found

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 429 Too Many Requests Error

Resource Exhausted

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 500 Internal Server Error

Internal Server

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

### 503 Service Unavailable Error

Service Unavailable

- `message` (string, required)
- `code` (string, optional)
- `errors` (list of string, optional)

## Types

### ModelConnectionImport

- `direction` (enum, required)
  - Allowed values: `outgoing`, `bidirectional`
- `id` (string, required)
- `name` (string, required)
- `originId` (string, required) — Model object that initiates the connection
- `targetId` (string, required) — Model object that receives the message
- `description` (string, optional) — Detailed description
- `labels` (map from string to string, optional)
- `links` (list of ImportLink, optional)
- `status` (enum, optional)
  - Allowed values: `deprecated`, `future`, `live`, `removed`
- `tagIds` (list of string, optional) — Tag IDs assigned to this model
- `technologyIds` (list of string, optional) — Technology IDs assigned to this model
- `viaId` (string, optional) — Model object that facilitates the connection, such as a Kafka topic, or RabbitMQ queue

### ModelObjectImport

- `id` (string, required)
- `name` (string, required)
- `type` (enum, required)
  - Allowed values: `domain`, `actor`, `app`, `component`, `group`, `store`, `system`
- `caption` (string, optional) — Display description
- `description` (string, optional) — Detailed description
- `external` (boolean, optional) — Whether the model object is an external service
- `groupIds` (list of string, optional)
- `icon` (ImportIcon, optional, nullable)
- `labels` (map from string to string, optional)
- `links` (list of ImportLink, optional)
- `parentId` (string, optional, nullable) — Parent model object ID, must follow the IcePanel hierarchy. Domain: parent must be missing/null Actor/System: parent must be a domain Group: parent must be a domain or another group App/Store: parent must be a system Component: parent must be an app or store
- `status` (enum, optional)
  - Allowed values: `deprecated`, `future`, `live`, `removed`
- `tagIds` (list of string, optional)
- `teamIds` (list of string, optional)
- `technologyIds` (list of string, optional)

### TagGroupImport

- `icon` (enum, required)
  - Allowed values: `bug`, `calendar-check`, `calendar-times`, `cloud`, `cog`, `database`, `exclamation-triangle`, `file`, `globe`, `laptop-code`, `lightbulb`, `lock`, `microchip`, `minus`, `mobile`, `network-wired`, `plus`, `poo`, `robot`, `rocket`, `sack-dollar`, `server`, `sledding`, `snowman`, `star`, `times`, `toolbox`, `trash`, `users`, `wifi`
- `id` (string, required)
- `name` (string, required)
- `labels` (map from string to string, optional)

### TagImport

- `color` (enum, required)
  - Allowed values: `blue`, `green`, `yellow`, `orange`, `red`, `beaver`, `dark-blue`, `purple`, `pink`, `white`, `grey`, `black`
- `groupId` (string, required) — Parent tag group ID
- `id` (string, required)
- `name` (string, required)
- `labels` (map from string to string, optional)

### LandscapeImport

- `createdAt` (datetime, required)
- `createdBy` (enum, required)
  - Allowed values: `user`, `api-key`, `notification-key`, `service`
- `createdById` (string, required)
- `deleteAt` (datetime, required)
- `id` (string, required)
- `landscapeId` (string, required)
- `status` (enum, required)
  - Allowed values: `in-progress`, `completed`, `error`
- `versionId` (string, required)
- `completedAt` (datetime, optional)
- `errors` (list of LandscapeImportError, optional)
- `prune` (boolean, optional) — When enabled, entities that are missing from the import will be deleted.

### ImportLink

- `url` (string, required) — Accessible link URL when not using a connector
- `customName` (string, optional) — Friendly name for the link set by the user
- `id` (string, optional) — Random 20 character identifier

### ImportIcon

- `technologyId` (string, required)

### LandscapeImportError

- `message` (string, required)
- `code` (string, optional)
- `entityId` (string, optional) — The id of the entity where the error occurred
- `entityOriginalId` (string, optional) — The not using the standard id format, this will be the original import identifier
- `entityType` (enum, optional)
  - Allowed values: `model-object`, `model-connection`, `tag`, `tag-group`

## Examples

**Request**

```json
{
  "modelConnections": [
    {
      "direction": "outgoing",
      "id": "connection-1",
      "name": "Connection",
      "originId": "object-2",
      "targetId": "object-3"
    }
  ],
  "modelObjects": [
    {
      "id": "object-1",
      "name": "Domain",
      "type": "domain"
    },
    {
      "id": "object-2",
      "name": "System",
      "type": "system",
      "groupIds": [
        "object-3"
      ],
      "parentId": "object-1"
    },
    {
      "id": "object-3",
      "name": "Group",
      "type": "group",
      "parentId": "object-1",
      "tagIds": [
        "tag-1"
      ]
    }
  ],
  "tagGroups": [
    {
      "icon": "bug",
      "id": "tag-group-1",
      "name": "Tag Group"
    }
  ],
  "tags": [
    {
      "color": "beaver",
      "groupId": "tag-group-1",
      "id": "tag-1",
      "name": "Tag"
    }
  ]
}
```

**Response**

```json
{
  "landscapeImport": {
    "createdAt": "2024-01-15T09:30:00Z",
    "createdBy": "user",
    "createdById": "string",
    "deleteAt": "2024-01-15T09:30:00Z",
    "id": "string",
    "landscapeId": "string",
    "status": "in-progress",
    "versionId": "string",
    "completedAt": "2024-01-15T09:30:00Z",
    "errors": [
      {
        "message": "string",
        "code": "string",
        "entityId": "string",
        "entityOriginalId": "string",
        "entityType": "model-object"
      }
    ],
    "prune": true
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.icepanel.io/v1/landscapes/landscapeId/versions/versionId/import"

payload = {
    "modelConnections": [
        {
            "direction": "outgoing",
            "id": "connection-1",
            "name": "Connection",
            "originId": "object-2",
            "targetId": "object-3"
        }
    ],
    "modelObjects": [
        {
            "id": "object-1",
            "name": "Domain",
            "type": "domain"
        },
        {
            "id": "object-2",
            "name": "System",
            "type": "system",
            "groupIds": ["object-3"],
            "parentId": "object-1"
        },
        {
            "id": "object-3",
            "name": "Group",
            "type": "group",
            "parentId": "object-1",
            "tagIds": ["tag-1"]
        }
    ],
    "tagGroups": [
        {
            "icon": "bug",
            "id": "tag-group-1",
            "name": "Tag Group"
        }
    ],
    "tags": [
        {
            "color": "beaver",
            "groupId": "tag-group-1",
            "id": "tag-1",
            "name": "Tag"
        }
    ]
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.icepanel.io/v1/landscapes/landscapeId/versions/versionId/import"

	payload := strings.NewReader("{\n  \"modelConnections\": [\n    {\n      \"direction\": \"outgoing\",\n      \"id\": \"connection-1\",\n      \"name\": \"Connection\",\n      \"originId\": \"object-2\",\n      \"targetId\": \"object-3\"\n    }\n  ],\n  \"modelObjects\": [\n    {\n      \"id\": \"object-1\",\n      \"name\": \"Domain\",\n      \"type\": \"domain\"\n    },\n    {\n      \"id\": \"object-2\",\n      \"name\": \"System\",\n      \"type\": \"system\",\n      \"groupIds\": [\n        \"object-3\"\n      ],\n      \"parentId\": \"object-1\"\n    },\n    {\n      \"id\": \"object-3\",\n      \"name\": \"Group\",\n      \"type\": \"group\",\n      \"parentId\": \"object-1\",\n      \"tagIds\": [\n        \"tag-1\"\n      ]\n    }\n  ],\n  \"tagGroups\": [\n    {\n      \"icon\": \"bug\",\n      \"id\": \"tag-group-1\",\n      \"name\": \"Tag Group\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"color\": \"beaver\",\n      \"groupId\": \"tag-group-1\",\n      \"id\": \"tag-1\",\n      \"name\": \"Tag\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```csharp
using RestSharp;

var client = new RestClient("https://api.icepanel.io/v1/landscapes/landscapeId/versions/versionId/import");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"modelConnections\": [\n    {\n      \"direction\": \"outgoing\",\n      \"id\": \"connection-1\",\n      \"name\": \"Connection\",\n      \"originId\": \"object-2\",\n      \"targetId\": \"object-3\"\n    }\n  ],\n  \"modelObjects\": [\n    {\n      \"id\": \"object-1\",\n      \"name\": \"Domain\",\n      \"type\": \"domain\"\n    },\n    {\n      \"id\": \"object-2\",\n      \"name\": \"System\",\n      \"type\": \"system\",\n      \"groupIds\": [\n        \"object-3\"\n      ],\n      \"parentId\": \"object-1\"\n    },\n    {\n      \"id\": \"object-3\",\n      \"name\": \"Group\",\n      \"type\": \"group\",\n      \"parentId\": \"object-1\",\n      \"tagIds\": [\n        \"tag-1\"\n      ]\n    }\n  ],\n  \"tagGroups\": [\n    {\n      \"icon\": \"bug\",\n      \"id\": \"tag-group-1\",\n      \"name\": \"Tag Group\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"color\": \"beaver\",\n      \"groupId\": \"tag-group-1\",\n      \"id\": \"tag-1\",\n      \"name\": \"Tag\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```