This method has been replaced with Update File Descriptor, and will be removed on March 31, 2023.
Updates a file.
Deprecation Notice:
This endpoint has been replaced with Update File Descriptor and will be removed on March 31, 2023.
Specify the parentFolderId
parameter to move a file from its current folder to a different folder.
You can only call this method when authenticated as a Wix app or Wix user identity.
File name that appears in the Media Manager.
ID of the file's parent folder.
Default: media-root
.
Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.
Information about the updated file.
curl --location --request PATCH 'www.wixapis.com/site-media/v1/files/update-file' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'authorization: <AUTH>' \
--data-raw '{
"fileId": "2acbb8_f968336b3fea5cbebc056d5c41f9944d~mv2.png",
"displayName": "new name",
"parentFolderId": "media-root",
"labels": ["image", "logo"]
}'
{
"file": {
"id": "2acbb8_f968336b3fea4cbebc056d5c41f5944d~mv2.png",
"displayName": "new name",
"url": "https://static.wixstatic.com/media/2acbb8_f668336b3fea4cbebc056d5c41f9944d~mv2.png",
"parentFolderId": "media-root",
"hash": "354c465d4dd665d5e0d9e1840d6e516a",
"sizeInBytes": "7108",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "2acbb8_f968336b3fea4cbebc056d5c41f9944d~mv2.png",
"url": "https://static.wixstatic.com/media/2acbb8_f968336b33ea4cbebc056d5c41f9944d~mv2.png",
"height": 184,
"width": 544,
"altText": null,
"urlExpirationDate": null,
"filename": "new name",
"sizeInBytes": "7108"
},
"colors": null,
"faces": [],
"previewImage": null
}
},
"operationStatus": "READY",
"sourceUrl": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png",
"thumbnailUrl": "https://static.wixstatic.com/media/2acbb8_f964336b3fea4cbebc056d5c41f9944d~mv2.png",
"labels": ["image", "logo"],
"createdDate": "2022-08-31T18:20:39Z",
"updatedDate": "2022-08-31T18:24:39Z",
"state": "OK"
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.