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

# Export

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

Create a background job that exports a landscape in the specified format.

Reference: https://developer.icepanel.io/api-reference/landscapes/export/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

- `type` (enum, required)
  - Allowed values: `pdf`, `markdown`, `html`, `llms`, `json`, `object-csv`, `connection-csv`
- `filter` (LandscapeExportFilter, optional)

### Body (application/json)

This endpoint expects a LandscapeExportOptions.

- `draftId` (string, optional) — Fetch and apply draft tasks before producing the export
- `orientation` (enum, optional) — Orientation to use when exporting to PDF, defaults to portrait
  - Allowed values: `portrait`, `landscape`
- `schema` (enum, optional) — Schema version to use for JSON exports, defaults to v1
  - Allowed values: `v1`, `v2`

## Response

### 200

OK

- `landscapeExport` (LandscapeExport, 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)

## Types

### LandscapeExportFilter

- `diagramId` (string, optional)
- `flowId` (string, optional)
- `includeDiagrams` (boolean, optional) — Whether or not to include diagrams in PDF exports, defaults to true
- `includeFlows` (boolean, optional) — Whether or not to include flows in PDF exports, defaults to true
- `modelObjectId` (string, optional)

### LandscapeExport

- `createdAt` (datetime, required)
- `deleteAt` (datetime, required)
- `error` (string, required, nullable)
- `fileUrl` (string, required, nullable)
- `id` (string, required)
- `landscapeId` (string, required)
- `type` (enum, required)
  - Allowed values: `pdf`, `markdown`, `html`, `llms`, `json`, `object-csv`, `connection-csv`
- `versionId` (string, required)
- `completedAt` (datetime, optional)
- `filter` (LandscapeExportFilter, optional)
- `options` (LandscapeExportOptions, optional)

### LandscapeExportOptions

- `draftId` (string, optional) — Fetch and apply draft tasks before producing the export
- `orientation` (enum, optional) — Orientation to use when exporting to PDF, defaults to portrait
  - Allowed values: `portrait`, `landscape`
- `schema` (enum, optional) — Schema version to use for JSON exports, defaults to v1
  - Allowed values: `v1`, `v2`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "landscapeExport": {
    "createdAt": "2024-01-15T09:30:00Z",
    "deleteAt": "2024-01-15T09:30:00Z",
    "error": "string",
    "fileUrl": "string",
    "id": "string",
    "landscapeId": "string",
    "type": "pdf",
    "versionId": "string",
    "completedAt": "2024-01-15T09:30:00Z",
    "filter": {
      "diagramId": "string",
      "flowId": "string",
      "includeDiagrams": true,
      "includeFlows": true,
      "modelObjectId": "string"
    },
    "options": {
      "draftId": "string",
      "orientation": "portrait",
      "schema": "v1"
    }
  }
}
```

**SDK Code**

```python
import requests

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

querystring = {"type":"pdf"}

payload = {}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```go
package main

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

func main() {

	url := "https://api.icepanel.io/v1/landscapes/landscapeId/versions/versionId/export?type=pdf"

	payload := strings.NewReader("{}")

	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/export?type=pdf");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```