---
title: "Audit model files"
method: GET
path: "/v1/models/{modelId}/files/audit"
tags: ["Files"]
---

# Audit model files

`GET /v1/models/{modelId}/files/audit`

Lists all files for a model from both database and storage, identifying orphaned files that exist in storage but not in the database

## Path parameters

- `modelId` string, required

## Response `200`

File audit results

- object — File audit results
  - `database_files` object[], required — Files recorded in the database
    - `id` string
    - `filename` string
    - `file_path` string
    - `file_size` number
    - `file_type` string
    - `created_at` string, nullable
    - `metadata` object
  - `storage_files` object[], required — Files found in storage bucket
    - `name` string
    - `id` string, nullable
    - `updated_at` string, nullable
    - `created_at` string, nullable
    - `last_accessed_at` string, nullable
    - `metadata` object
  - `orphaned_files` object[], required — Files in storage but not in database
    - `name` string
    - `path` string
    - `size` number
    - `last_modified` string, nullable
  - `summary` object, required
    - `total_database_files` number
    - `total_storage_files` number
    - `total_orphaned_files` number

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