# Delete File

Deletes a file by its filename (`reference`), which is unique per tenant.
## Authentication
Requires a valid API key in the `X-API-KEY` header.
## Example

```
DELETE /files(product-datasheet.pdf)
X-API-KEY: your-api-key-here
```
## Response (204 No Content)
Success returns no body.
## Important: deletion does not cascade
The file record is removed outright. The deletion is **not** propagated to the entities that use
the file — check `numLinks` on the file first (`GET /files({reference})`): if it is greater than
zero, the products, variants and categories still referencing the filename will be left pointing
at a file that no longer exists. Repoint them via the Catalog API before deleting.
## Error Responses
- **401 Unauthorized**: Missing or invalid API key. Returned by the API gateway as
`{ "message": "Unauthorized", "request_id": "d8aafa5b8f3e400b60bea0123dd33317" }`
- **403 Forbidden**: The API key does not have write permissions for this operation. Same body
shape as the 401
- **404 Not Found**: No file with the given reference exists for this tenant. The body is the
message string, e.g. `"File with reference 'missing.pdf' not found"`
- **500 Internal Server Error**: Technical error (e.g. database unavailable)

Unlike `DELETE /images({reference})` this operation has no 409 conflict: only images are queued
for background processing, so a file is never locked by an in-flight process.

Endpoint: DELETE /files({reference})
Version: 2.0.0

## Description:

  - `Authentication` ()
    Requires a valid API key in the X-API-KEY header.

  - `Example` ()
    DELETE /files(product-datasheet.pdf)
X-API-KEY: your-api-key-here
DELETE /files(product-datasheet.pdf)
X-API-KEY: your-api-key-here

  - `Response (204 No Content)` ()
    Success returns no body.

  - `Important: deletion does not cascade` ()
    The file record is removed outright. The deletion is not propagated to the entities that usethe file — check numLinks on the file first (GET /files({reference})): if it is greater thanzero, the products, variants and categories still referencing the filename will be left pointingat a file that no longer exists. Repoint them via the Catalog API before deleting.

  - `Error Responses` ()
    401 Unauthorized: Missing or invalid API key. Returned by the API gateway as{ "message": "Unauthorized", "request_id": "d8aafa5b8f3e400b60bea0123dd33317" }403 Forbidden: The API key does not have write permissions for this operation. Same bodyshape as the 401404 Not Found: No file with the given reference exists for this tenant. The body is themessage string, e.g. "File with reference 'missing.pdf' not found"500 Internal Server Error: Technical error (e.g. database unavailable) Unlike DELETE /images({reference}) this operation has no 409 conflict: only images are queuedfor background processing, so a file is never locked by an in-flight process.

## Path parameters:

  - `reference` (string, required)
    File name (reference), unique per tenant

## Header parameters:

  - `X-API-KEY` (string, required)
    Tenant's API key (required)

## Response 204:

  - `204` (unknown)
    No Content

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `message` (string)
    Error description, e.g. `Unauthorized`.

  - `request_id` (string)
    Gateway request identifier, to quote when contacting support.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `message` (string)

  - `request_id` (string)

## Response 404:

  - `404` (unknown)
    Not Found

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `error` (string)

  - `details` (any)

