PATCH /api/user/files/:id
Update metadata for a specific file. All fields are optional - only include the fields you want to update.Path Parameters
The file ID or file name to update. Both the unique file ID (
clxyz123) and the file name on server (abc123.png) are accepted.Request Body
Mark the file as favorite or unfavorite
Maximum number of views before the file is deleted. Must be 0 or greater. Set to 0 to remove the limit.
Set or remove password protection.
- Provide a password string to set protection
- Set to
nullor empty string to remove protection
Update the original file name. Must be at least 1 character and cannot contain invalid path characters.
Update the MIME type of the file (e.g.,
image/png, application/pdf)Array of tag IDs to associate with this file. All tag IDs must exist and belong to the file owner.
Update the file name on the server. Must be unique across all files.
Changing the file name will physically rename the file in the datasource and update the file’s URL.
Response
Returns the updated file object with the same structure as the Get File endpoint.Unique file identifier
File name on server (updated if changed)
Original name of the uploaded file (updated if changed)
File size in bytes
MIME type of the file (updated if changed)
Number of times the file has been viewed
Maximum allowed views before deletion (updated if changed)
Whether the file is marked as favorite (updated if changed)
Whether the file is password-protected (updated if changed)
ID of the folder containing this file
ISO 8601 timestamp of file creation
ISO 8601 timestamp of last update (will be current time)
ISO 8601 timestamp of scheduled deletion
Full URL to access the file (updated if name changed)
Thumbnail information if available
Array of tag objects (updated if changed)
Example Request
Example Response
Error Responses
400 Bad Request
- Invalid tag IDs provided
- File with the new name already exists
- Invalid path characters in file name
404 Not Found
The file does not exist, or you don’t have permission to update it.
500 Internal Server Error
Failed to rename file in datasource (occurs when changing the
name field)