{
  "openapi": "3.0.1",
  "info": {
    "title": "Mermaid Diagram Actor",
    "description": "Convert Text description or Mermaid code to PNG, SVG, or PDF images. Flowcharts, sequence diagrams, Gantt charts, ER diagrams and more.",
    "version": "1.0",
    "x-build-id": "o1CVZpdemge9AmfUs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/salesmart-srl~mermaid-diagram-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-salesmart-srl-mermaid-diagram-actor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/salesmart-srl~mermaid-diagram-actor/runs": {
      "post": {
        "operationId": "runs-sync-salesmart-srl-mermaid-diagram-actor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/salesmart-srl~mermaid-diagram-actor/run-sync": {
      "post": {
        "operationId": "run-sync-salesmart-srl-mermaid-diagram-actor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mermaidCode": {
            "title": "📝 Mermaid Code",
            "type": "string",
            "description": "Paste your Mermaid diagram code here. Copy from mermaid.live or write your own. Tip: Use Form view (not JSON) to paste multiline code directly."
          },
          "aiDiagramType": {
            "title": "🤖 AI Mode: Diagram Type",
            "enum": [
              "",
              "flowchart",
              "sequence",
              "er",
              "gantt",
              "pie",
              "state",
              "class",
              "mindmap",
              "timeline",
              "quadrant",
              "gitgraph",
              "sankey",
              "xy"
            ],
            "type": "string",
            "description": "Select the type of diagram you want AI to generate. Then describe it in the field below.",
            "default": ""
          },
          "aiDescription": {
            "title": "🤖 AI Mode: Description",
            "type": "string",
            "description": "Describe your diagram in plain English. AI will generate the Mermaid code for you. Example: \"User logs in, if valid show dashboard, otherwise show error\""
          },
          "openaiApiKey": {
            "title": "🔑 OpenAI API Key",
            "type": "string",
            "description": "Required for AI Mode. Get your key at platform.openai.com/api-keys"
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "png",
              "svg",
              "pdf"
            ],
            "type": "string",
            "description": "The format of the generated diagram image",
            "default": "png"
          },
          "theme": {
            "title": "Theme",
            "enum": [
              "default",
              "forest",
              "dark",
              "neutral",
              "base"
            ],
            "type": "string",
            "description": "Visual theme for the diagram",
            "default": "default"
          },
          "backgroundColor": {
            "title": "Background Color",
            "type": "string",
            "description": "Background color: white, transparent, #ff0000, etc.",
            "default": "white"
          },
          "scale": {
            "title": "Scale (Quality)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Resolution multiplier 1-5 (PNG only). Scale 2 = 2x dimensions. Higher = sharper but larger file. Ignored for SVG/PDF.",
            "default": 3
          },
          "diagrams": {
            "title": "Batch Mode: Multiple Diagrams",
            "type": "array",
            "description": "Generate multiple diagrams. Each can have its own settings (theme, format, etc.) or use global defaults.",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "title": "Mermaid Code",
                  "type": "string",
                  "description": "Mermaid diagram code"
                },
                "name": {
                  "title": "File Name",
                  "type": "string",
                  "description": "Output file name (without extension)"
                },
                "outputFormat": {
                  "title": "Output Format",
                  "type": "string",
                  "enum": [
                    "png",
                    "svg",
                    "pdf"
                  ],
                  "description": "Override global format for this diagram"
                },
                "theme": {
                  "title": "Theme",
                  "type": "string",
                  "enum": [
                    "default",
                    "forest",
                    "dark",
                    "neutral",
                    "base"
                  ],
                  "description": "Override global theme for this diagram"
                },
                "backgroundColor": {
                  "title": "Background Color",
                  "type": "string",
                  "description": "Override global background for this diagram"
                },
                "scale": {
                  "title": "Scale",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 5,
                  "description": "Override global scale for this diagram (PNG only)"
                },
                "maxWidth": {
                  "title": "Max Width",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 4096,
                  "description": "Override global maxWidth for this diagram"
                },
                "maxHeight": {
                  "title": "Max Height",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 4096,
                  "description": "Override global maxHeight for this diagram"
                }
              },
              "required": [
                "code"
              ]
            }
          },
          "maxWidth": {
            "title": "Max Width (pixels)",
            "minimum": 0,
            "maximum": 4096,
            "type": "integer",
            "description": "Resize diagram to fit this width. Keeps aspect ratio. 0 = no limit. Works with PNG, SVG, and PDF.",
            "default": 0
          },
          "maxHeight": {
            "title": "Max Height (pixels)",
            "minimum": 0,
            "maximum": 4096,
            "type": "integer",
            "description": "Resize diagram to fit this height. Keeps aspect ratio. 0 = no limit. Works with PNG, SVG, and PDF.",
            "default": 0
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}