---
title: "Archive (soft-delete) a file"
method: DELETE
path: "/api/workspaces/{slug}/files/{fileId}"
tags: ["Files"]
---

# Archive (soft-delete) a file

`DELETE /api/workspaces/{slug}/files/{fileId}`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/files/{fileId}`
- Auth: HTTP bearer

Sets archivedAt + the archivedBy stamp. Blob stays in storage and the org's storage counter stays incremented until the 30-day trash cleanup cron hard-deletes it. Restorable via PATCH `{ restore: true }`.

## Path parameters

- `slug` string, required
- `fileId` string, required

## Response `200`

Archived

- object
  - `ok` true, required

## Other responses

- `404`: Not found or already archived

## Changes

- **2026-11-05** `767beae124a8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/trydock/apis/dock-rest-api/changes/api/workspaces/:slug/files/:fileId/delete.md)

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
