---
title: "Preview file by ID"
method: GET
path: "/api/workspace/files/{file_id}/preview"
tags: ["workspace"]
---

# Preview file by ID

`GET /api/workspace/files/{file_id}/preview`

Return a cheap preview of a file.

Images/PDFs/Office docs are returned as a small WebP thumbnail; text-like
files return only their first ``bytes`` bytes. Used by the Artifacts page so
a grid of files no longer downloads every file in full.

## Path parameters

- `file_id` string, required

## Query parameters

- `w` integer
- `bytes` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `401` — Authentication required
- `422` — Validation Error

## Changes

- **2026-06-04** `aac16d58e966` — 1 info
  - endpoint added
- **2026-04-30** `8c84efcb3afb` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/changes/api/workspace/files/:file_id/preview/get.md)

---

[API](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/revisions/a8f415ca28ec?raw)
