{
  "openapi": "3.0.1",
  "info": {
    "title": "Diagram Renderer: Mermaid & Graphviz to SVG, PNG, PDF",
    "description": "Turn Mermaid or Graphviz (DOT) code into SVG, PNG or PDF files with a hosted link. Batch up to 100 diagrams per run. Built for AI agents, docs pipelines and n8n/Make/Zapier flows. Pay only for diagrams that render.",
    "version": "1.0",
    "x-build-id": "sQPewHxvAl1u5M2vP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dryboneslabs~diagram-renderer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dryboneslabs-diagram-renderer",
        "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/dryboneslabs~diagram-renderer/runs": {
      "post": {
        "operationId": "runs-sync-dryboneslabs-diagram-renderer",
        "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/dryboneslabs~diagram-renderer/run-sync": {
      "post": {
        "operationId": "run-sync-dryboneslabs-diagram-renderer",
        "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": {
          "source": {
            "title": "Diagram code",
            "type": "string",
            "description": "Mermaid (flowchart, sequence, class, state, ER, gantt, pie, mindmap, timeline, ...) or Graphviz DOT code. Ignored when <b>Batch of diagrams</b> is filled. Max 50,000 characters.",
            "default": "flowchart LR\n    A[Agent writes diagram code] --> B{Diagram Renderer}\n    B -->|Mermaid| C[SVG / PNG / PDF]\n    B -->|Graphviz DOT| C\n    C --> D[(Key-value store URL)]"
          },
          "diagrams": {
            "title": "Batch of diagrams",
            "type": "array",
            "description": "Up to 100 diagrams per run. Each item: <code>{ \"source\": \"...\", \"id\"?: \"file-name\", \"engine\"?: \"auto|mermaid|graphviz\", \"format\"?: \"svg|png|pdf\", \"theme\"?, \"background\"?, \"scale\"?, \"width\"?, \"layout\"? }</code>. Plain strings are accepted as <code>source</code>. Missing fields use the options below."
          },
          "engine": {
            "title": "Engine",
            "enum": [
              "auto",
              "mermaid",
              "graphviz"
            ],
            "type": "string",
            "description": "<b>auto</b> detects Graphviz DOT (<code>digraph { ... }</code> / <code>graph { ... }</code>) and treats everything else as Mermaid.",
            "default": "auto"
          },
          "format": {
            "title": "Output format",
            "enum": [
              "png",
              "svg",
              "pdf"
            ],
            "type": "string",
            "description": "SVG (vector, smallest), PNG (image) or PDF (single page sized to the diagram).",
            "default": "png"
          },
          "theme": {
            "title": "Mermaid theme",
            "enum": [
              "default",
              "neutral",
              "dark",
              "forest",
              "base"
            ],
            "type": "string",
            "description": "Mermaid color theme. Ignored for Graphviz (style DOT with its own attributes).",
            "default": "default"
          },
          "background": {
            "title": "Background color",
            "type": "string",
            "description": "CSS color such as <code>white</code>, <code>transparent</code>, <code>#f5f5f5</code> or <code>rgb(0,0,0)</code>. Empty = white (dark grey for the Mermaid dark theme)."
          },
          "scale": {
            "title": "PNG scale",
            "minimum": 0.5,
            "maximum": 4,
            "type": "number",
            "description": "Pixel density for PNG output: 1 = normal, 2 = sharp/retina (default), up to 4. Large diagrams are scaled down automatically to stay under 16 megapixels.",
            "default": 2
          },
          "width": {
            "title": "Width (px)",
            "minimum": 16,
            "maximum": 8000,
            "type": "integer",
            "description": "Optional target width in CSS pixels. The height follows the aspect ratio. Empty = the diagram's natural size."
          },
          "layout": {
            "title": "Graphviz layout engine",
            "enum": [
              "dot",
              "neato",
              "fdp",
              "sfdp",
              "circo",
              "twopi",
              "osage",
              "patchwork"
            ],
            "type": "string",
            "description": "Layout algorithm for Graphviz: dot (hierarchical, default), neato/fdp/sfdp (force-directed), circo (circular), twopi (radial), osage, patchwork. Ignored for Mermaid.",
            "default": "dot"
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}