---
title: "Get a file"
method: GET
path: "/api/files/{fileId}"
---

# Get a file

`GET /api/files/{fileId}`

Retrieves a single file including its document content and canvas elements.

## Path parameters

- `fileId` string, required

## Response `200`

The file with its content

- FileWithContent
  - `id` string, required — Unique identifier for the file
  - `fileUrl` string, required — URL to view the file in Eraser
  - `title` string, required — Title of the file
  - `author` string, required — User ID of the file author
  - `folderId` string, nullable, required — ID of the folder containing the file, or null if not in a folder
  - `createdAt` string, date-time, required — ISO 8601 timestamp of when the file was created
  - `updatedAt` string, date-time, required — ISO 8601 timestamp of when the file was last updated
  - `linkAccess` 'no-link-access' | 'anyone-with-link-can-edit' | 'publicly-viewable' | 'publicly-editable' | 'sso-readable' | 'sso-editable', required — Current link access setting for the file
  - `content` object, required
    - `elements` object[], required — Canvas elements in the file
      - `id` string, required — Unique identifier for the element
      - `type` string, required — Type of the element (e.g., "diagram", "rectangle", "ellipse")
      - `diagramType` 'sequence-diagram' | 'entity-relationship-diagram' | 'cloud-architecture-diagram' | 'flowchart-diagram' | 'bpmn-diagram' — Type of diagram. Only present when `type` is "diagram".
      - `code` string — Eraser DSL code. Only present when `type` is "diagram".
      - `x` number — X position on the canvas
      - `y` number — Y position on the canvas
      - `width` number — Width of the element
      - `height` number — Height of the element
    - `document` string, required — Markdown content of the file's document

## Other responses

- `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

---

[API](https://skmtc.net/eraser/apis/render.md) · [All operations](https://skmtc.net/eraser/apis/render/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eraser/render/versions/c31350b435dc/schema)
