---
title: "previewFile"
method: GET
path: "/v1/files/{id}/preview"
tags: ["Preview"]
---

# previewFile

`GET /v1/files/{id}/preview`

Generate a thumbnail preview for a file entity.

Supported file types include images (PNG, JPEG, GIF, WebP), PDFs, and common document formats.
The preview is returned as an image (PNG or JPEG).

**Tip:** Use with CookieAuth to embed previews directly in `<img>` tags.

## Path parameters

- `id` union, required
  - string — Empty string (used when file ID not yet assigned)
  - string, uuid — Valid UUID v4

## Query parameters

- `version` integer
- `w` integer
- `h` integer

## Response `200`

Generated thumbnail image

## Other responses

- `401` — Authentication required or invalid credentials
- `403` — Insufficient permissions to access the resource
- `404` — The requested resource was not found
- `500` — An unexpected error occurred on the server

---

[API](https://skmtc.net/epilot/apis/file-api.md) · [All operations](https://skmtc.net/epilot/apis/file-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/file-api/revisions/4d61b97f1e97/schema)
