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

# previewPublicFile

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

Generate a thumbnail preview for a public file entity.

**No authentication required.** This endpoint only works for files with `access_control: public-read`.

## 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
- `org_id` string

## Response `200`

Generated thumbnail image for a public file

## Other responses

- `204` — No preview could be generated and no redirect target is available (the file has no public URL). No body is returned.
- `302` — The preview could not be optimized (e.g. image dimensions above the input pixel limit, an oversized file, or an unsupported/undecodable format). Since the file is public, the client is redirected to the original file, which the browser can render directly.
- `304` — The preview is unchanged since the version identified by the `If-None-Match` request header. No body is returned; the cached copy should be reused.
- `403` — File is not public
- `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)
