> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete File

> Delete a file and all its variants from storage

Deletes a file record and removes all associated storage objects. For image files, all generated variants are also deleted.

Requires an authenticated user. **Delete is owner-or-service:** a user token may only delete files it owns; **service/master keys** may delete any file in the project. Backend-owned files (uploaded without a `userId`) are deletable only with a service/master key.

**Rate limit**: 50 requests per 5 minutes.

## Path Parameters

<ParamField path="fileId" type="string" required>
  The UUID of the file to delete.
</ParamField>

## Response

```json theme={null}
{
  "message": "File deleted successfully",
  "fileId": "uuid",
  "deletedPaths": [
    "images/abc123/original.webp",
    "images/abc123/thumbnail_original.webp",
    "images/abc123/medium_original.webp"
  ]
}
```

`deletedPaths` lists all storage paths that were removed, including the original file and any image variants.

## Error Responses

<AccordionGroup>
  <Accordion title="Not Found — 404">
    ```json theme={null}
    { "error": "File not found", "code": "storage/file-not-found" }
    ```
  </Accordion>

  <Accordion title="Unauthorized — 403">
    Returned when a user token attempts to delete a file it does not own.

    ```json theme={null}
    { "error": "Unauthorized", "code": "storage/unauthorized" }
    ```
  </Accordion>
</AccordionGroup>
