Reads the currentDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/Storx/llms.txt
Use this file to discover all available pages before exploring further.
isTrash value of the specified file and atomically flips it (false → true to trash, true → false to restore). This is a soft-delete operation — no data is removed from ImageKit CDN and the database record remains intact and fully recoverable.
Toggling
isTrash back to false fully restores the file — it reappears in
the user’s file browser as if it was never trashed. To permanently delete
a file and remove it from ImageKit CDN, use
DELETE /api/files/[fileId] instead.Request
Method:PATCHPath:
/api/files/{fileId}/trashContent-Type:
application/jsonAuth: Clerk session cookie required. The
userId body field must match the session’s user ID.
Path Parameters
UUID of the file or folder whose trash status should be toggled. Must belong
to the authenticated user; otherwise a
404 is returned.Request Body
The Clerk user ID of the authenticated user. Must match the session’s
userId
exactly. Checked before any database operation is performed. The desired trash
state is not accepted as a parameter — the endpoint always toggles the
current database value.Response
200 — Success
Returns the full updatedFileItem object with the toggled isTrash value applied. The response is the raw record, not wrapped in a container object.
UUID primary key of the file or folder.
Display name of the file or folder.
ImageKit storage path. Unchanged by this operation.
File size in bytes (
0 for folders).MIME type of the file (e.g.
"image/jpeg", "application/pdf").Public ImageKit CDN URL. The file remains accessible via this URL even while
trashed — the flag only controls UI visibility.
ImageKit-generated thumbnail URL. May be
null.Clerk user ID of the file owner.
UUID of the parent folder, or
null if at root.true if the record represents a folder.Current star status, unchanged by this endpoint.
The toggled trash status — the new persisted value after the PATCH.
true means the file is in the trash; false means it has been restored.ISO 8601 creation timestamp.
ISO 8601 timestamp of the most recent update.
Error Responses
| Status | Error message | Cause |
|---|---|---|
400 | "File id is required" | The fileId path parameter is missing or empty. |
401 | "Unauthorized" | No active Clerk session, or userId body field doesn’t match the session user. |
404 | "File not found" | No file with that UUID exists for this user. |
500 | "Failed to mark file as trash" | Unexpected database error during the update. |