Create a file

Creates a new Eraser file with optional document content and canvas elements.

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

Example request

curl --location 'https://app.eraser.io/api/files' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $YOUR-TOKEN-HERE' \
--data '{
    "title": "My File",
    "document": "# Hello\n\nThis is a test."
}'

An example request with diagram elements:

curl --location 'https://app.eraser.io/api/files' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $YOUR-TOKEN-HERE' \
--data '{
    "title": "Diagram File",
    "elements": [
        {
            "type": "diagram",
            "diagramType": "sequence-diagram",
            "code": "A > B: Hello"
        }
    ]
}'

Example response

{
  "id": "abc123",
  "fileUrl": "https://app.eraser.io/workspace/abc123",
  "title": "My File",
  "author": "api",
  "folderId": null,
  "createdAt": "2025-07-15T09:30:00.000Z",
  "updatedAt": "2025-07-15T09:30:00.000Z",
  "linkAccess": "no-link-access",
  "content": {
    "elements": [],
    "document": "# Hello\n\nThis is a test."
  }
}
Body Params
string

Title of the file. Defaults to "Untitled".

string

ID of the folder to place the file in

string

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

string
enum

Link access setting for the file. See https://docs.eraser.io/docs/sharing-a-file for more information.

Allowed:
elements
array of objects

Canvas elements to add to the file (diagrams, shapes, etc.)

elements
Responses

400

Invalid request body

401

Missing or invalid bearer token

403

Unauthorized

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