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

# Update

PATCH https://api.icepanel.io/v1/landscapes/{landscapeId}/versions/{versionId}/diagrams/{diagramId}/content
Content-Type: application/json

Reference: https://developer.icepanel.io/api-reference/diagrams/content/update

## 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)
- `diagramId` (string, required)

### Query parameters

- `updateViewedAt` (boolean, optional)

### Body (application/json)

This endpoint expects a DiagramContentPartial.

- `comments` (DiagramContentPartialComments, optional) — Operations to apply to the comments on the diagram
- `commit` (double, optional) — The commit number of the diagram content, incremented on each change
- `connections` (DiagramContentPartialConnections, optional) — Operations to apply to the connections on the diagram
- `objects` (DiagramContentPartialObjects, optional) — Operations to apply to the objects on the diagram

## Response

### 200

OK

- `diagramContent` (DiagramContent, 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)

### 409 Conflict Error

Conflict

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

### DiagramContentPartialComments

Operations to apply to the comments on the diagram

- `$add` (map from string to DiagramComment, optional) — Add new comments to the diagram, keyed by comment id
- `$remove` (list of string, optional) — Remove comments from the diagram by id
- `$replace` (map from string to DiagramComment, optional) — Replace all comments on the diagram, keyed by comment id
- `$update` (map from string to DiagramCommentPartial, optional) — Update existing comments on the diagram, keyed by comment id

### DiagramContentPartialConnections

Operations to apply to the connections on the diagram

- `$add` (map from string to DiagramConnectionRequired, optional) — Add new connections to the diagram, keyed by connection id
- `$remove` (list of string, optional) — Remove connections from the diagram by id
- `$replace` (map from string to DiagramConnectionRequired, optional) — Replace all connections on the diagram, keyed by connection id
- `$update` (map from string to DiagramConnectionPartial, optional) — Update existing connections on the diagram, keyed by connection id

### DiagramContentPartialObjects

Operations to apply to the objects on the diagram

- `$add` (map from string to DiagramObjectRequired, optional) — Add new objects to the diagram, keyed by object id
- `$remove` (list of string, optional) — Remove objects from the diagram by id
- `$replace` (map from string to DiagramObjectRequired, optional) — Replace all objects on the diagram, keyed by object id
- `$update` (map from string to DiagramObjectPartial, optional) — Update existing objects on the diagram, keyed by object id

### DiagramContent

- `comments` (map from string to DiagramComment, required) — The comments on the diagram, keyed by comment id
- `commit` (double, required) — The commit number of the diagram content, incremented on each change
- `connections` (map from string to DiagramConnection, required)
- `objects` (map from string to DiagramObject, required)
- `createdAt` (datetime, required)
- `createdBy` (enum, required)
  - Allowed values: `user`, `api-key`, `notification-key`, `service`
- `createdById` (string, required)
- `groupId` (string, required, nullable) — The id of the diagram group the diagram belongs to, null when not in a group
- `handleId` (string, required) — A short id of the diagram stable across landscape versions
- `id` (string, required)
- `landscapeId` (string, required)
- `modelId` (string, required) — The id of the model object the diagram belongs to
- `name` (string, required)
- `status` (enum, required)
  - Allowed values: `current`
- `type` (enum, required)
  - Allowed values: `app-diagram`, `component-diagram`, `context-diagram`
- `updatedAt` (datetime, required)
- `updatedBy` (enum, required)
  - Allowed values: `user`, `api-key`, `notification-key`, `service`
- `updatedById` (string, required)
- `version` (double, required) — The version number of the diagram content, incremented on each update
- `versionId` (string, required)
- `deletedAt` (datetime, optional)
- `deletedBy` (enum, optional)
  - Allowed values: `user`, `api-key`, `notification-key`, `service`
- `deletedById` (string, optional)
- `latestEntityId` (string, optional)
- `viewedAt` (datetime, optional)
- `viewedBy` (enum, optional)
  - Allowed values: `user`, `api-key`, `notification-key`, `service`
- `viewedById` (string, optional)

### DiagramComment

- `commentId` (string, required) — The id of the comment this marker displays
- `id` (string, required) — The id of the comment marker, unique within the diagram
- `x` (double, required) — The x position of the comment on the diagram
- `y` (double, required) — The y position of the comment on the diagram

### DiagramCommentPartial

- `commentId` (string, optional) — The id of the comment this marker displays
- `id` (string, optional) — The id of the comment marker, unique within the diagram
- `x` (double, optional) — The x position of the comment on the diagram
- `y` (double, optional) — The y position of the comment on the diagram

### DiagramConnectionRequired

- `modelId` (string, required, nullable) — The id of the model connection this connection represents
- `originId` (string, required, nullable) — The id of the diagram object the connection starts from
- `targetId` (string, required, nullable) — The id of the diagram object the connection ends at
- `breakpoints` (list of DiagramConnectionRequiredBreakpointsItems, optional) — User-controlled corner waypoints the connection routes through, ordered origin to target. Only valid on square connections, breakpoints are not stored on any other line shape and setting them on one is rejected. The path must be a valid orthogonal L-shape: consecutive breakpoints share an x or a y (no diagonals), no two are identical, and every interior breakpoint is a right-angle corner (segments alternate horizontal/vertical, no collinear or backtracking points).
- `labelPosition` (double, optional) — The percentage along the line where the label should be placed, defaults to 50
- `lineShape` (enum, optional) — The visual style of a connection line
  - Allowed values: `curved`, `square`, `straight`
- `originConnector` (enum, optional) — The anchor point on the edge of the origin object where the connection attaches
  - Allowed values: `top-left`, `top-center`, `top-right`, `right-top`, `right-middle`, `right-bottom`, `bottom-right`, `bottom-center`, `bottom-left`, `left-bottom`, `left-middle`, `left-top`
- `targetConnector` (enum, optional) — The anchor point on the edge of the target object where the connection attaches
  - Allowed values: `top-left`, `top-center`, `top-right`, `right-top`, `right-middle`, `right-bottom`, `bottom-right`, `bottom-center`, `bottom-left`, `left-bottom`, `left-middle`, `left-top`
- `points` (list of DiagramConnectionRequiredPointsItems, optional, deprecated) — Deprecated: points are now computed automatically

### DiagramConnectionPartial

- `breakpoints` (list of DiagramConnectionPartialBreakpointsItems, optional) — User-controlled corner waypoints the connection routes through, ordered origin to target. Only valid on square connections, breakpoints are not stored on any other line shape and setting them on one is rejected. The path must be a valid orthogonal L-shape: consecutive breakpoints share an x or a y (no diagonals), no two are identical, and every interior breakpoint is a right-angle corner (segments alternate horizontal/vertical, no collinear or backtracking points).
- `labelPosition` (double, optional) — The percentage along the line where the label should be placed, defaults to 50
- `lineShape` (enum, optional) — The visual style of a connection line
  - Allowed values: `curved`, `square`, `straight`
- `modelId` (string, optional, nullable) — The id of the model connection this connection represents
- `originConnector` (enum, optional) — The anchor point on the edge of the origin object where the connection attaches
  - Allowed values: `top-left`, `top-center`, `top-right`, `right-top`, `right-middle`, `right-bottom`, `bottom-right`, `bottom-center`, `bottom-left`, `left-bottom`, `left-middle`, `left-top`
- `originId` (string, optional, nullable) — The id of the diagram object the connection starts from
- `targetConnector` (enum, optional) — The anchor point on the edge of the target object where the connection attaches
  - Allowed values: `top-left`, `top-center`, `top-right`, `right-top`, `right-middle`, `right-bottom`, `bottom-right`, `bottom-center`, `bottom-left`, `left-bottom`, `left-middle`, `left-top`
- `targetId` (string, optional, nullable) — The id of the diagram object the connection ends at
- `points` (list of DiagramConnectionPartialPointsItems, optional, deprecated) — Deprecated: points are now computed automatically

### DiagramObjectRequired

- `modelId` (string, required) — The id of the model object this object represents
- `shape` (enum, required)
  - Allowed values: `area`, `box`
- `type` (enum, required)
  - Allowed values: `actor`, `app`, `component`, `group`, `store`, `system`
- `x` (double, required) — The x position of the object. Calculated automatically for area shapes, set to 0 when creating an area
- `y` (double, required) — The y position of the object. Calculated automatically for area shapes, set to 0 when creating an area
- `height` (double, optional) — The height of the object. Calculated automatically for area shapes, set to 0 when creating an area, defaults to 128
- `width` (double, optional) — The width of the object. Calculated automatically for area shapes, set to 0 when creating an area, defaults to 256

### DiagramObjectPartial

An object placed on a diagram

- `height` (double, optional) — The height of the object. Calculated automatically for area shapes, set to 0 when creating an area, defaults to 128
- `modelId` (string, optional) — The id of the model object this object represents
- `shape` (enum, optional)
  - Allowed values: `area`, `box`
- `type` (enum, optional)
  - Allowed values: `actor`, `app`, `component`, `group`, `store`, `system`
- `width` (double, optional) — The width of the object. Calculated automatically for area shapes, set to 0 when creating an area, defaults to 256
- `x` (double, optional) — The x position of the object. Calculated automatically for area shapes, set to 0 when creating an area
- `y` (double, optional) — The y position of the object. Calculated automatically for area shapes, set to 0 when creating an area

### DiagramConnection

- `labelPosition` (double, required) — The percentage along the line where the label should be placed, defaults to 50
- `lineShape` (enum, required) — The visual style of a connection line
  - Allowed values: `curved`, `square`, `straight`
- `modelId` (string, required, nullable) — The id of the model connection this connection represents
- `originConnector` (enum, required) — The anchor point on the edge of the origin object where the connection attaches
  - Allowed values: `top-left`, `top-center`, `top-right`, `right-top`, `right-middle`, `right-bottom`, `bottom-right`, `bottom-center`, `bottom-left`, `left-bottom`, `left-middle`, `left-top`
- `originId` (string, required, nullable) — The id of the diagram object the connection starts from
- `targetConnector` (enum, required) — The anchor point on the edge of the target object where the connection attaches
  - Allowed values: `top-left`, `top-center`, `top-right`, `right-top`, `right-middle`, `right-bottom`, `bottom-right`, `bottom-center`, `bottom-left`, `left-bottom`, `left-middle`, `left-top`
- `targetId` (string, required, nullable) — The id of the diagram object the connection ends at
- `id` (string, required) — The id of the connection, unique within the diagram
- `breakpoints` (list of DiagramConnectionBreakpointsItems, optional) — User-controlled corner waypoints the connection routes through, ordered origin to target. Only valid on square connections, breakpoints are not stored on any other line shape and setting them on one is rejected. The path must be a valid orthogonal L-shape: consecutive breakpoints share an x or a y (no diagonals), no two are identical, and every interior breakpoint is a right-angle corner (segments alternate horizontal/vertical, no collinear or backtracking points).
- `points` (list of DiagramConnectionPointsItems, optional, deprecated) — Deprecated: points are now computed automatically

### DiagramObject

- `height` (double, required) — The height of the object. Calculated automatically for area shapes, set to 0 when creating an area, defaults to 128
- `modelId` (string, required) — The id of the model object this object represents
- `shape` (enum, required)
  - Allowed values: `area`, `box`
- `type` (enum, required)
  - Allowed values: `actor`, `app`, `component`, `group`, `store`, `system`
- `width` (double, required) — The width of the object. Calculated automatically for area shapes, set to 0 when creating an area, defaults to 256
- `x` (double, required) — The x position of the object. Calculated automatically for area shapes, set to 0 when creating an area
- `y` (double, required) — The y position of the object. Calculated automatically for area shapes, set to 0 when creating an area
- `id` (string, required) — The id of the object, unique within the diagram

### DiagramConnectionRequiredBreakpointsItems

- `x` (double, required)
- `y` (double, required)

### DiagramConnectionRequiredPointsItems

- `x` (double, required)
- `y` (double, required)

### DiagramConnectionPartialBreakpointsItems

- `x` (double, required)
- `y` (double, required)

### DiagramConnectionPartialPointsItems

- `x` (double, required)
- `y` (double, required)

### DiagramConnectionBreakpointsItems

- `x` (double, required)
- `y` (double, required)

### DiagramConnectionPointsItems

- `x` (double, required)
- `y` (double, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "diagramContent": {
    "comments": {},
    "commit": 1.1,
    "connections": {},
    "objects": {},
    "createdAt": "2024-01-15T09:30:00Z",
    "createdBy": "user",
    "createdById": "string",
    "groupId": "string",
    "handleId": "string",
    "id": "string",
    "landscapeId": "string",
    "modelId": "string",
    "name": "string",
    "status": "current",
    "type": "app-diagram",
    "updatedAt": "2024-01-15T09:30:00Z",
    "updatedBy": "user",
    "updatedById": "string",
    "version": 1.1,
    "versionId": "string",
    "deletedAt": "2024-01-15T09:30:00Z",
    "deletedBy": "user",
    "deletedById": "string",
    "latestEntityId": "string",
    "viewedAt": "2024-01-15T09:30:00Z",
    "viewedBy": "user",
    "viewedById": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.icepanel.io/v1/landscapes/landscapeId/versions/versionId/diagrams/diagramId/content"

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

response = requests.patch(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/diagrams/diagramId/content"

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

	req, _ := http.NewRequest("PATCH", 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/diagrams/diagramId/content");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```