Update a diagram

Updates the code of an existing diagram in a file.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Example request

curl --location --request PUT 'https://app.eraser.io/api/files/abc123/diagrams/diag1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $YOUR-TOKEN-HERE' \
--data '{
    "code": "A > C: Updated"
}'

Example response

{
  "id": "diag1",
  "diagramUrl": "https://app.eraser.io/workspace/abc123?diagram=diag1&layout=canvas",
  "diagramType": "sequence-diagram",
  "code": "A > C: Updated",
  "updatedAt": "2025-07-15T10:00:00.000Z"
}
Path Params
string
required

ID of the file containing the diagram

string
required

ID of the diagram to update

Body Params
string
required

New Eraser DSL code for the diagram

Responses

400

Invalid file ID, diagram ID, or missing code field

401

Missing or invalid bearer token

403

Unauthorized

404

File or diagram not found

500

Internal server error

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json