post
https://app.eraser.io/api/files//diagrams
Creates a new diagram element on the file's canvas.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Example request
curl --location 'https://app.eraser.io/api/files/abc123/diagrams' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $YOUR-TOKEN-HERE' \
--data '{
"diagramType": "flowchart-diagram",
"code": "Start > End"
}'
Example response
{
"id": "diag2",
"diagramUrl": "https://app.eraser.io/workspace/abc123?diagram=diag2&layout=canvas",
"diagramType": "flowchart-diagram",
"code": "Start > End",
"updatedAt": "2025-07-15T09:30:00.000Z"
} 400Invalid file ID or missing diagramType
401Missing or invalid bearer token
403Unauthorized
404File not found (or file is private, archived, a template, or belongs to a different team)
500Internal server error