Docs
Schedule demo Open app

Update a file

PUT https://app.eraser.io/api/files/{fileId}

Example request

curl --location --request PUT 'https://app.eraser.io/api/files/abc123' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $YOUR-TOKEN-HERE' \
--data '{
    "title": "Updated Title",
    "document": "# Updated Content"
}'

Example response

{
  "id": "abc123",
  "fileUrl": "https://app.eraser.io/workspace/abc123",
  "title": "Updated Title",
  "author": "user-id-1",
  "folderId": null,
  "createdAt": "2025-07-01T12:00:00.000Z",
  "updatedAt": "2025-07-15T10:00:00.000Z",
  "linkAccess": "no-link-access",
  "content": {
    "elements": [],
    "document": "# Updated Content"
  }
}

Path parameters

fileId string requiredpath

ID of the file to update

Request body

title string

New title for the file

folderId string

ID of the folder to move the file to

document string

New markdown content for the file's document. Replaces existing document content. Supports diagram code blocks (e.g., ```sequence-diagram) which are converted to embedded diagrams.

Responses

200 – The updated file with its content

400 – Invalid file ID

401 – Missing or invalid bearer token

403 – Unauthorized

404 – File not found (or file is private, archived, a template, or belongs to a different team)

500 – Internal server error