# Model Imports

You can import data to IcePanel from many different data sources. Generally speaking there are 2 ways to import data: via the UI (see below) and via our [rest-api](https://docs.icepanel.io/integrations/rest-api "mention").

{% hint style="info" %}
Only Admins can import data into IcePanel.
{% endhint %}

Importing into IcePanel adds the model objects and their connections to the model, but it does not create the corresponding diagrams. After importing, we recommend using the model viewer to visualize the new relationships.

## Importing via the UI

If you’re working in a new landscape, or if your landscape contains fewer than 20 objects, 10 connections, and 2 diagrams, you will see the following banner:

<figure><img src="https://4065434276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHewp5hylgOsOa0VDOBo%2Fuploads%2FEPImBhbeXmpORQOqUGDd%2Fimage.png?alt=media&#x26;token=b5319bf1-41dd-41e3-92e8-f2df2ff99574" alt=""><figcaption><p>Import banner</p></figcaption></figure>

By selecting Import Model, you will be prompted to create a file. Upload a YAML or JSON file to automatically import objects, connections and tags into IcePanel. **You can easily generate this file from a data source, script or using an LLM.**

You can also access this import banner from the model objects/connections tables by hitting the import button at the top right:

<figure><img src="https://4065434276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHewp5hylgOsOa0VDOBo%2Fuploads%2FVT7od8GLJHj7C2hxeUaZ%2Fimage.png?alt=media&#x26;token=82f8c048-24e1-4d72-bcec-d434cf995ba2" alt=""><figcaption><p>Import from model object/connection tables</p></figcaption></figure>

{% hint style="info" %}
You are currently not able to export from IcePanel, modify the file and then import back into IcePanel. For that purpose, we recommend looking at our API.
{% endhint %}

### How to create the import file

**1. Learn about the import file structure**

Visit the developer documentation at:

```
https://developer.icepanel.io
```

Alternatively, provide an **LLM** with the **JSON schema** available at:

```
https://api.icepanel.io/v1/schemas/LandscapeImportData
```

***

**2. Enable schema validation for YAML files**

If you are using a YAML file for the import, add the following **prefix** to validate the file structure in your IDE:

```
# yaml-language-server: $schema=https://api.icepanel.io/v1/schemas/LandscapeImportData
```

***

**3. Generate the import file using an LLM (optional)**

You can use an LLM to generate the import file automatically. Example prompt:

```
Generate an IcePanel landscape import data model based on the C4 model from the infrastructure and software architecture of the platform.
Parse infrastructure files to understand the platform and use it to map the infrastructure into C4 model abstraction.
Do not create objects or connections that don't exist or are strongly implied by the infrastructure.
Fetch LandscapeImportData JSONSchema from api.icepanel.io/v1/schemas/LandscapeImportData along with nested schemas and strictly follow the schema to create a YAML file for import into IcePanel.
Fetch docs.icepanel.io/core-features/modelling.md for context on how to create IcePanel C4 model structures.
Infrastructure can be categorized into technologies by fetching the JSONSchema from api.icepanel.io/v1/schemas/CatalogTechnologyType.
Perform an exhaustive search for technologies using http requests to api.icepanel.io/v1/catalog/technologies?filter[name]=NodeJS and add the id to the technologyIds array.
If a technology cannot be found try reducing the search term to be more specific to find a match.
If a primary technology exists then assign the visual icon to icon.technologyId.
Write the resulting import data to a YAML file to the file named icepanel-landscape-import.yaml in the current directory.
Prefix the YAML file with # yaml-language-server: $schema=https://api.icepanel.io/v1/schemas/LandscapeImportData.
```

***

**4. Upload the file**

Upload the **JSON or YAML file** using the upload field above to import the objects, connections, and tags into your landscape.
