All paths are relative to https://api.diagrams.so/api/v2 and require a bearer key.

Generate a diagram

Create a diagram from a prompt. Billable. Generation is AI-backed and can take 30 seconds or more; for live progress use streaming, and set a generous client timeout.
Response

Generate with streaming

is billable. Same inputs as generate, but streams progress as the diagram is produced, so you can show live status during long generations. When you don’t need progress, use POST /diagrams above.

Get a diagram

Read a diagram by id. Free.

List diagrams

List your diagrams, newest first. Free. Supports pagination via limit and cursor.

Update a diagram

is free. Update metadata such as title or visibility.

Edit a diagram

Apply a natural-language edit. Billable. Typically takes 10 to 20 seconds.
The response returns the updated xml, a refreshed score and warnings, and usage.

Fix a warning

Apply a fix for a specific Well-Architected finding. Billable. Typically takes 10 to 20 seconds. See Warnings & score.

Re-layout a diagram

Re-arrange the diagram for readability. Runs as an async job. See Async operations for polling.

Import a draw.io file

Bring an existing draw.io diagram in so you can edit and export it. Free to import.

Delete a diagram

Delete a diagram you own. Free.
Versions: every edit/fix creates a version. List, read, and revert via the versions endpoints, documented in the Async & versions section.