v1

latestOpenAPI 3.1.02026-07-2418848.0 KB

Create a diagram in a file

Creates a new diagram element on the file's canvas.

post/api/files/{fileId}/diagrams

Path parameters

fileIdstring required

ID of the file to add the diagram to

Request body

diagramType'sequence-diagram' | 'entity-relationship-diagram' | 'cloud-architecture-diagram' | 'flowchart-diagram' | 'bpmn-diagram' required

Type of diagram to create

codestring

Eraser DSL code for the diagram. If omitted, creates an empty diagram.

Response

The created diagram

idstring required

Unique identifier for the diagram

diagramUrlstring required

URL to view the diagram in the Eraser canvas

diagramType'sequence-diagram' | 'entity-relationship-diagram' | 'cloud-architecture-diagram' | 'flowchart-diagram' | 'bpmn-diagram' required

Type of the diagram

codestring required

Eraser DSL code for the diagram

updatedAtstring date-time required

ISO 8601 timestamp of when the diagram was last updated

Example response

{
  "diagramUrl": "https://app.eraser.io/workspace/abc123?diagram=def456&layout=canvas"
}