---
title: "Clean up orphaned files"
method: DELETE
path: "/v1/models/{modelId}/files/cleanup"
tags: ["Files"]
---

# Clean up orphaned files

`DELETE /v1/models/{modelId}/files/cleanup`

Deletes orphaned files from storage that are not recorded in the database

## Path parameters

- `modelId` string, required

## Request body

- object
  - `orphaned_file_paths` string[], required — Array of file paths to delete
  - `organizationId` string — Organization ID (optional, defaults to user's primary organization)

## Response `200`

Cleanup results

- object — Cleanup results
  - `success` boolean, required
  - `deleted_files` string[], required — Successfully deleted file paths
  - `failed_deletions` object[], required — Failed deletion attempts
    - `path` string
    - `error` string

## Other responses

- `404` — Model not found
- `500` — Internal server error

---

[API](https://skmtc.net/printhiv3d/apis/hive-api-documentation.md) · [All operations](https://skmtc.net/printhiv3d/apis/hive-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/printhiv3d/hive-api-documentation/versions/3b06bcb5f808/schema)
