Kroki provides a unified API with support for BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag), C4 (with PlantUML), Ditaa, Erd, GraphViz, Nomnoml, Mermaid, PlantUML, SvgBob, UMLet, Vega… and more to come!
This section offers a basic tutorial for evaluating Kroki. More comprehensive installation instructions are in the Kroki documentation.
Kroki uses a simple algorithm (deflate + base64) to encode your diagram in the URL:
GET /plantuml/svg/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
You can also call Kroki with POST:
POST /
{
"diagram_source": "Bob -> Alice : hello",
"diagram_type": "plantuml",
"output_format": "svg"
}In this case, you don’t need to encode your diagram.
It’s also possible to send your diagram as plain text using the Content-Type header.
The output format will be specified using the Accept header and the diagram source will be sent as the request body:
POST /plantuml
Accept: image/svg+xml
Content-Type: text/plain
Bob -> Alice : helloYou can also define the output format in the URL if you don’t want to add an Accept header:
POST /plantuml/svg
Content-Type: text/plain
Bob -> Alice : helloThe same concept applies when sending the diagram as JSON:
POST /plantuml/svg
{
"diagram_source": "Bob -> Alice : hello"
}