Skip to main content

Shape

A shape is a geometric element on the project map with configurable type, fill, and stroke.

Item type: shape

Properties

PropertyTypeRequiredUpdatableDefaultDescription
positionobjectNoYes{ x: 0, y: 0 }Position with x and y fields.
sizeobjectYesYesSize with width and height fields. Min 5 per dimension.
scalenumberNoYes1Scale factor. Must be > 0.
anglenumberNoYes0Rotation angle (0360).
typestringNoNo"Rectangle"Shape type. Immutable after creation. See Shape Types.
fillColorstringNoYesTransparentFill color as a CSS color string.
strokeColorstringNoYes"#FFFFFF"Stroke (border) color as a CSS color string.
strokeThicknessnumberNoYes2Stroke width in pixels. Must be ≥ 0.
adjustmentValuesnumber[]NoYes[]Shape-specific adjustment values. Each value must be ≥ 0.
warning

The type property is immutable — it can only be set during creation and cannot be changed via update.

Shape Types

The following shape types are supported (case-insensitive):

TypeDescription
RectangleStandard rectangle
EllipseEllipse / circle
RoundedRectangleRectangle with rounded corners
TriangleEquilateral triangle
RightTriangleRight-angled triangle
DiamondDiamond / rhombus
HexagonRegular hexagon
HeptagonRegular heptagon
OctagonRegular octagon
DecagonRegular decagon
DodecagonRegular dodecagon
PentagonRegular pentagon
ParallelogramParallelogram
TrapezoidTrapezoid
PlusPlus / cross shape
DonutRing / donut shape
HeartHeart shape
LightningBoltLightning bolt
Star44-pointed star
Star55-pointed star
Star66-pointed star
DirectionArrowBidirectional arrow
DirectionArrowRightRight-pointing direction arrow
DirectionArrowLeftLeft-pointing direction arrow
RightArrowRight arrow
LeftArrowLeft arrow
UpArrowUp arrow
DownArrowDown arrow
LeftRightArrowLeft-right arrow
UpDownArrowUp-down arrow
QuadArrowFour-directional arrow
LeftRightUpArrowLeft-right-up arrow
StripedRightArrowStriped right arrow
NotchedRightArrowNotched right arrow
PlaquePlaque shape
FrameFrame shape
HalfFrameHalf-frame shape
CornerCorner shape
OneSnipCornerRectangleRectangle with one snipped corner
TwoSameSideSnipCornerRectangleRectangle with two same-side snipped corners
TwoDiagonalSnipCornerRectangleRectangle with two diagonal snipped corners
OneSnipOneRoundCornerRectangleRectangle with one snipped and one rounded corner
OneRoundCornerRectangleRectangle with one rounded corner
TwoSameSideRoundCornerRectangleRectangle with two same-side rounded corners
TwoDiagonalRoundCornerRectangleRectangle with two diagonal rounded corners

Create

Creates a new shape item in the project.

POST /api/v2/projects/{projectId}/item/{parent}/shape

curl

curl -X POST "https://api.deon.cloud/api/v2/projects/{projectId}/item/inbox/shape" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Ellipse",
"position": { "x": 200, "y": 300 },
"size": { "width": 150, "height": 150 },
"fillColor": "#4CAF50",
"strokeColor": "#2E7D32",
"strokeThickness": 3
}'

JavaScript

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/inbox/shape`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "Ellipse",
position: { x: 200, y: 300 },
size: { width: 150, height: 150 },
fillColor: "#4CAF50",
strokeColor: "#2E7D32",
strokeThickness: 3,
}),
}
);

const data = await response.json();
console.log(data.itemId);

Response

{
"itemId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}

Update

Updates an existing shape. Only include the properties you want to change. The type property cannot be updated.

PATCH /api/v2/projects/{projectId}/item/shape/{itemId}

curl

curl -X PATCH "https://api.deon.cloud/api/v2/projects/{projectId}/item/shape/{itemId}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"fillColor": "#FF9800",
"strokeThickness": 5
}'

JavaScript

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/shape/${itemId}`,
{
method: "PATCH",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
fillColor: "#FF9800",
strokeThickness: 5,
}),
}
);

const data = await response.json();
console.log(data.itemId);

Response

{
"itemId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}