files
Replace file
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.
put/files/{id}
Request
- Base URLhttps://{subdomain}.storage.{region}.nhost.run/v1
- URLhttps://{subdomain}.storage.{region}.nhost.run/v1/files/{id}
- AuthHTTP bearer
Path parameters
idstring required
Unique identifier of the file to replace
Request body multipart/form-data
Example request
{
"metadata": {
"name": "renamed-file.jpg",
"metadata": {
"alt": "Updated image description",
"category": "profile"
}
}
}Response
File successfully replaced
Example response
{
"id": "d5e76ceb-77a2-4153-b7da-1f7c115b2ff2",
"name": "profile-picture.jpg",
"size": 245678,
"bucketId": "users-bucket",
"etag": "\"a1b2c3d4e5f6\"",
"createdAt": "2023-01-15T12:34:56Z",
"updatedAt": "2023-01-16T09:45:32Z",
"isUploaded": true,
"mimeType": "image/jpeg",
"uploadedByUserId": "abc123def456",
"metadata": {
"alt": "Profile picture",
"category": "avatar"
}
}Changes
No recorded changes to this operation across all 7 revisions of this API.