v1
latestOpenAPI 3.1.02026-07-13121824.2 KBDiagrams
Save Diagram
Save a generated diagram to the database.
AUTHENTICATION REQUIRED - Must include valid JWT token in Authorization header.
Args: save_request: Diagram data to save db: Database session current_user: Authenticated user
Returns: DiagramResponse with saved diagram data including ID
post/api/diagrams
Request body
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
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
}