Replace file
PUT /files/{id}
Replace an existing file with new content while preserving the file ID. The operation follows these steps:
- The isUploaded flag is set to false to mark the file as being updated
- The file content is replaced in the storage backend
- File metadata is updated (size, mime-type, isUploaded, etc.)
Each step is atomic, but if a step fails, previous steps will not be automatically rolled back.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Unique identifier of the file to replace
Request Body required
Section titled “Request Body required ”File replacement data including new file content and optional metadata
object
Metadata that can be updated for an existing file.
object
New name to assign to the file.
Example
renamed-file.jpgUpdated custom metadata to associate with the file.
object
Example
{ "alt": "Updated image description", "category": "profile"}New file content to replace the existing file
Responses
Section titled “ Responses ”File successfully replaced
Comprehensive metadata information about a file in storage.
object
Unique identifier for the file.
Example
d5e76ceb-77a2-4153-b7da-1f7c115b2ff2Name of the file including extension.
Example
profile-picture.jpgSize of the file in bytes.
Example
245678ID of the bucket containing the file.
Example
users-bucketEntity tag for cache validation.
Example
"a1b2c3d4e5f6"Timestamp when the file was created.
Example
2023-01-15T12:34:56ZTimestamp when the file was last updated.
Example
2023-01-16T09:45:32ZWhether the file has been successfully uploaded.
Example
trueMIME type of the file.
Example
image/jpegID of the user who uploaded the file.
Example
abc123def456Custom metadata associated with the file.
object
Example
{ "alt": "Profile picture", "category": "avatar"}default
Section titled “default ”Error occurred during file replacement
Error information returned by the API.
object
Error details.
object
Human-readable error message.
Example
File not foundAdditional data related to the error, if any.