---
title: "Archive a file"
method: DELETE
path: "/api/files/{fileId}"
---

# Archive a file

`DELETE /api/files/{fileId}`

Archives (soft-deletes) a file. The file can be restored from the trash in the Eraser UI.

## Path parameters

- `fileId` string, required

## Response `200`

The file was archived successfully

- object
  - `archived` boolean, required — Whether the file was archived
  - `fileUrl` string, required — URL of the archived file

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