Updates a file.
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.
The file to update.
Information about the updated file.
curl -X PATCH \
'https://www.wixapis.com/site-media/v1/files/update-file-descriptor' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"file": {
"id": "6acbb8_f968336b3fea4cbebc056d5c41f5944d~mv2.png",
"displayName": "New File Name",
"parentFolderId": "media-root",
"labels": ["image", "logo"]
},
"fieldMask": {
"paths": [
"file.displayName",
"file.parentFolderId",
"file.labels"
]
}
}'
{
"file": {
"id": "6acbb8_f968336b3fea4cbebc056d5c41f5944d~mv2.png",
"displayName": "New File Name",
"url": "https://static.wixstatic.com/media/6acbb8_f668336b3fea4cbebc056d5c41f9944d~mv2.png",
"parentFolderId": "media-root",
"hash": "354c465d4dd665d5e0d9e1840d6e516a",
"sizeInBytes": "7108",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "6acbb8_f968336b3fea4cbebc056d5c41f9944d~mv2.png",
"url": "https://static.wixstatic.com/media/6acbb8_f968336b33ea4cbebc056d5c41f9944d~mv2.png",
"height": 184,
"width": 544,
"altText": null,
"urlExpirationDate": null,
"filename": "New File 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/6acbb8_f964336b3fea4cbebc056d5c41f9944d~mv2.png",
"labels": ["image", "logo"],
"createdDate": "2022-08-31T18:20:39Z",
"updatedDate": "2022-08-31T18:24:39Z"
}
}
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.