v1

latestOpenAPI 3.1.02026-07-13121824.2 KB
Diagrams

Update Diagram

Update a specific diagram by ID.

AUTHENTICATION REQUIRED - Must include valid JWT token in Authorization header.

Args: diagram_id: ID of the diagram to update update_request: Fields to update (only provided fields will be updated) db: Database session current_user: Authenticated user

Returns: DiagramResponse with updated diagram data

Raises: 404: If diagram not found or doesn't belong to user

put/api/diagrams/{diagram_id}

Path parameters

diagram_idinteger required

Request body

titlestring nullable

Diagram title

descriptionstring nullable

Original user description

mermaid_codestring nullable

Generated Mermaid syntax

diagram_type'flowchart' | 'sequence' | 'mindmap' nullable

Type of diagram (flowchart, sequence, or mindmap)

diagram_jsonobject nullable

Complete diagram state: nodes, edges, layoutDirection, positions, customizations

Example request

{
  "title": "User Authentication Flow",
  "description": "User login process with OAuth2 authentication",
  "mermaid_code": "flowchart TB\n  start([Start])\n  finish([End])",
  "diagram_type": "flowchart",
  "diagram_json": {
    "edges": [],
    "layoutDirection": "TB",
    "nodes": []
  }
}

Response

Successful Response

idinteger required

Diagram ID

user_idinteger required

User ID who created the diagram

titlestring required

Diagram title

descriptionstring nullable

Original user description

mermaid_codestring required

Mermaid diagram syntax

diagram_typestring

Type of diagram (flowchart, sequence, or mindmap)

diagram_jsonobject required

Complete diagram state: nodes, edges, layoutDirection, positions, customizations

created_atstring required

Creation timestamp (ISO format)

updated_atstring required

Last update timestamp (ISO format)

Example response

{
  "created_at": "2025-01-01T00:00:00Z",
  "description": "User login process with OAuth2",
  "diagram_json": {
    "edges": [],
    "layoutDirection": "TB",
    "nodes": []
  },
  "diagram_type": "flowchart",
  "id": 1,
  "mermaid_code": "flowchart TB\n  start([Start])",
  "title": "User Authentication Flow",
  "updated_at": "2025-01-01T00:00:00Z",
  "user_id": 1
}