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

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/revisions/382041c7ecb2/schema)
