CodePic · Schema

update_diagram input

CompanyWhiteboardDiagrammingFlowchartsMCPAI AgentsVisual Collaboration

Properties

Name Type Description
documentId string Document ID to update (from a previous create call)
name string New document name
nodes array Full replacement of all nodes. If provided, replaces the entire canvas content.
edges array Full replacement of all edges
addNodes array Nodes to add (without replacing existing ones)
addEdges array Edges to add
removeNodeIds array IDs of nodes to remove
removeEdgeIds array IDs of edges to remove
backgroundColor string New canvas background color
View JSON Schema on GitHub

JSON Schema

codepic-cc-update-diagram-input-schema.json Raw ↑
{
  "type": "object",
  "properties": {
    "documentId": {
      "type": "string",
      "description": "Document ID to update (from a previous create call)"
    },
    "name": {
      "type": "string",
      "description": "New document name"
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique node ID"
          },
          "type": {
            "type": "string",
            "enum": [
              "rect",
              "ellipse",
              "circle",
              "diamond",
              "parallelogram",
              "document",
              "cylinder",
              "hexagon",
              "triangle",
              "callout",
              "cloud",
              "terminator",
              "cross",
              "off-page-connector",
              "actor",
              "note",
              "component",
              "end-node",
              "start-node",
              "fork-bar",
              "predefined-process",
              "delay",
              "manual-input",
              "stored-data",
              "text",
              "textarea",
              "link",
              "icon",
              "image",
              "frame",
              "package",
              "swimlane",
              "rounded-rect",
              "table",
              "button",
              "button-primary",
              "button-secondary",
              "button-destructive",
              "button-ghost",
              "input",
              "select",
              "checkbox",
              "radio",
              "switch",
              "slider",
              "progress",
              "server",
              "load-balancer",
              "firewall",
              "container",
              "msg-queue",
              "queue",
              "router",
              "lambda",
              "cache",
              "pod",
              "browser-frame",
              "mobile-frame",
              "code"
            ],
            "description": "Shape type (default: rect). Call get_shape_docs for full per-type field reference. Common: rect/rounded-rect=card, diamond=decision, parallelogram=I/O, cylinder=database, hexagon=service, actor=user, frame=container group, button-primary=blue CTA, button-destructive=danger action. Architecture: server, load-balancer, firewall, container, msg-queue, router, lambda, cache, pod. UI wireframe: input, select, checkbox, radio, switch, slider. Mockups: browser-frame, mobile-frame. Code: code (syntax-highlighted code block, set data.language and data.theme; calculate width/height from text content: charW=fontSize*0.6, width=lineNumW+32+maxLineChars*charW, height=24+lineCount*fontSize*lineHeight)."
          },
          "text": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "rich-text"
                  },
                  "version": {
                    "type": "number",
                    "const": 1
                  },
                  "blocks": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "paragraph"
                            },
                            "textAlign": {
                              "type": "string",
                              "enum": [
                                "left",
                                "center",
                                "right"
                              ]
                            },
                            "runs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "text": {
                                    "type": "string"
                                  },
                                  "style": {
                                    "type": "object",
                                    "properties": {
                                      "fontSize": {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      "fontFamily": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "fontColor": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "fontWeight": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "fontStyle": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "textDecoration": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "underline",
                                          "line-through"
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "href": {
                                    "type": "string",
                                    "format": "uri"
                                  }
                                },
                                "required": [
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              "minItems": 1
                            }
                          },
                          "required": [
                            "type",
                            "runs"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "list-item"
                            },
                            "listType": {
                              "type": "string",
                              "enum": [
                                "ordered",
                                "unordered"
                              ]
                            },
                            "level": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 5
                            },
                            "textAlign": {
                              "type": "string",
                              "enum": [
                                "left",
                                "center",
                                "right"
                              ]
                            },
                            "runs": {
                              "type": "array",
                              "items": {
                                "$ref": "#/properties/nodes/items/properties/text/anyOf/0/properties/blocks/items/anyOf/0/properties/runs/items"
                              },
                              "minItems": 1
                            }
                          },
                          "required": [
                            "type",
                            "listType",
                            "runs"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "kind",
                  "version",
                  "blocks"
                ],
                "additionalProperties": false
              },
              {
                "type": "string"
              }
            ],
            "description": "Text content. Use RichTextContent for normal shapes; code/input use a raw string; frame uses a string title."
          },
          "name": {
            "type": "string",
            "maxLength": 80,
            "description": "Stable semantic name for MCP/Agent understanding, e.g. 'payment-service'."
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "description": "Concise semantic purpose of this node, independent of its visible text."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 48
            },
            "maxItems": 12,
            "description": "Instance-level semantic tags for future MCP/Agent reads, e.g. ['backend','critical','pii']. Use get_shape_catalog tags for shape selection; use this field for the node's role in this diagram."
          },
          "x": {
            "type": "number",
            "description": "X position"
          },
          "y": {
            "type": "number",
            "description": "Y position"
          },
          "width": {
            "type": "number",
            "description": "Width (default: 200)"
          },
          "height": {
            "type": "number",
            "description": "Height (default: 80)"
          },
          "rotation": {
            "type": "number",
            "description": "Rotation angle in radians (default: 0)"
          },
          "fillColor": {
            "type": "string",
            "description": "Fill color, e.g. '#e3f2fd'"
          },
          "fillStyle": {
            "type": "string",
            "enum": [
              "none",
              "solid",
              "hachure",
              "cross-hatch"
            ],
            "description": "Fill style (default: solid)"
          },
          "strokeColor": {
            "type": "string",
            "description": "Stroke color, e.g. '#1565c0'"
          },
          "strokeWidth": {
            "type": "number",
            "description": "Stroke width in px (default: 2)"
          },
          "opacity": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Opacity 0-1 (default: 1)"
          },
          "roughness": {
            "type": "number",
            "minimum": 0,
            "maximum": 3,
            "description": "Hand-drawn roughness 0-3, 0=smooth, 3=very rough (default: 1)"
          },
          "corners": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "items": [
              {
                "type": "number"
              },
              {
                "type": "number"
              },
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ],
            "description": "Border radius [topLeft, topRight, bottomRight, bottomLeft] (default: [0,0,0,0]). Applies to ALL shape types \u2014 use to round corners for a more polished look. Rect/frame/input/select/button: [8,8,8,8]\u2013[16,16,16,16]. Rough style (roughness\u22651): small corners (4\u20138). Smooth (roughness:0): larger corners (12\u201320). Other shapes (diamond, hexagon, etc.) can also use corners for subtle rounding."
          },
          "fontColor": {
            "type": "string",
            "description": "Text color (default: '#333333')"
          },
          "fontSize": {
            "type": "number",
            "description": "Font size (default: 16)"
          },
          "fontFamily": {
            "type": "string",
            "description": "Font family (default: 'Inter, sans-serif')"
          },
          "fontWeight": {
            "type": "string",
            "enum": [
              "normal",
              "bold"
            ],
            "description": "Font weight (default: 'bold')"
          },
          "fontStyle": {
            "type": "string",
            "enum": [
              "normal",
              "italic"
            ],
            "description": "Font style (default: 'normal')"
          },
          "textAlign": {
            "type": "string",
            "enum": [
              "left",
              "center",
              "right"
            ],
            "description": "Horizontal text alignment (default: 'center')"
          },
          "verticalAlign": {
            "type": "string",
            "enum": [
              "top",
              "center",
              "bottom"
            ],
            "description": "Vertical text alignment (default: 'center')"
          },
          "lineHeight": {
            "type": "number",
            "description": "Line height multiplier (default: 1.2)"
          },
          "data": {
            "type": "object",
            "additionalProperties": {},
            "description": "Type-specific state data. Call get_shape_docs for the full field list. Examples: select\u2192{options:[{id,label}],selectedId,open}, checkbox/radio\u2192{checked}, switch\u2192{on}, slider\u2192{min,max,value}, input/textarea\u2192{placeholder}, link\u2192{href}, icon\u2192{iconName}, triangle\u2192{triangleDirection:'up'|'down'|'left'|'right'}, callout\u2192{calloutTailX,calloutBodyRatio}."
          },
          "parentId": {
            "type": "string",
            "description": "Parent container node ID. Nest this node inside another node (any type can be a container). The parent automatically becomes containable=true so users can keep dragging elements into it. Call get_shape_catalog with tag='container-capable' to choose a suitable parent shape. Provide x/y as absolute canvas coordinates \u2014 they are auto-converted to parent-relative coordinates. WHEN TO USE: whenever multiple nodes logically belong to the same module, region, or component, wrap them in a shared container and set parentId on each child. This lets users reposition the whole group and drag additional elements into it."
          }
        },
        "required": [
          "id",
          "text",
          "x",
          "y"
        ],
        "additionalProperties": false
      },
      "description": "Full replacement of all nodes. If provided, replaces the entire canvas content."
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique edge ID"
          },
          "sourceId": {
            "type": "string",
            "description": "Source node ID"
          },
          "targetId": {
            "type": "string",
            "description": "Target node ID"
          },
          "label": {
            "type": "string",
            "description": "Edge label text"
          }
        },
        "required": [
          "id",
          "sourceId",
          "targetId"
        ],
        "additionalProperties": false
      },
      "description": "Full replacement of all edges"
    },
    "addNodes": {
      "type": "array",
      "items": {
        "$ref": "#/properties/nodes/items"
      },
      "description": "Nodes to add (without replacing existing ones)"
    },
    "addEdges": {
      "type": "array",
      "items": {
        "$ref": "#/properties/edges/items"
      },
      "description": "Edges to add"
    },
    "removeNodeIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "IDs of nodes to remove"
    },
    "removeEdgeIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "IDs of edges to remove"
    },
    "backgroundColor": {
      "type": "string",
      "description": "New canvas background color"
    }
  },
  "required": [
    "documentId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "update_diagram input"
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/codepic-cc-update-diagram-input"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.