Skip to main content
curl -X DELETE "https://your-zipline.com/api/user/files/clxyz123" \
  -H "Authorization: YOUR_TOKEN"

DELETE /api/user/files/:id

Permanently delete a file from both the database and the datasource storage.
This action is irreversible. The file will be permanently deleted from the server.

Path Parameters

id
string
required
The file ID or file name to delete. Both the unique file ID (clxyz123) and the file name on server (abc123.png) are accepted.

Response

Returns the deleted file object with the same structure as the Get File endpoint.
id
string
Unique file identifier of the deleted file
name
string
File name that was on the server
originalName
string | null
Original name of the uploaded file
size
number
File size in bytes
type
string
MIME type of the file
views
number
Number of times the file was viewed before deletion
maxViews
number | null
Maximum allowed views that was set
favorite
boolean
Whether the file was marked as favorite
password
boolean
Whether the file was password-protected
folderId
string | null
ID of the folder that contained this file
createdAt
string
ISO 8601 timestamp of file creation
updatedAt
string
ISO 8601 timestamp of last update
deletesAt
string | null
ISO 8601 timestamp of scheduled deletion
url
string
The URL that was used to access the file (now inactive)
thumbnail
object | null
Thumbnail information that was available
tags
array
Array of tag objects that were associated with this file

Example Response

{
  "id": "clxyz123",
  "name": "abc123.png",
  "originalName": "screenshot.png",
  "size": 152400,
  "type": "image/png",
  "views": 42,
  "maxViews": null,
  "favorite": false,
  "password": false,
  "folderId": null,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "deletesAt": null,
  "url": "https://your-zipline.com/u/abc123.png",
  "thumbnail": {
    "path": "/thumbnails/abc123.jpg"
  },
  "tags": [
    {
      "id": "tag1",
      "name": "screenshots",
      "color": "#3b82f6",
      "createdAt": "2024-01-10T08:00:00.000Z",
      "updatedAt": "2024-01-10T08:00:00.000Z"
    }
  ]
}

Error Responses

404 Not Found
The file does not exist, or you don’t have permission to delete it.

Permissions

You can only delete files that:
  • You own, OR
  • Belong to a user with a lower role than yours (if you’re an admin/superadmin)

What Gets Deleted

  1. Database Record: The file entry is removed from the database
  2. Physical File: The actual file is deleted from the datasource storage
  3. Thumbnail: Associated thumbnail is automatically deleted via cascade
  4. Tags: Tag associations are removed (tags themselves are preserved)
The deletion is logged with the username, file name, size, and owner ID for audit purposes.

Build docs developers (and LLMs) love