To import files using Import File or Bulk Import File, you need to do one of the following for each file:
Specify its MIME type in the mimeType
field of the call. For example, mimeType: 'image/jpeg'
.
Specify its extension in either the displayName
or url
field of the request. For example, displayName: 'Example Image.jpeg
or url: https://www.example.com/image.jpeg
.
Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
Note: If you want to validate the media type, specify the file's expected media type in the optional mediaType
field of the call. For example, mediaType: 'IMAGE'
.
When you import a file using Import File or Bulk Import File, or upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Files can take time to import or upload and be processed. This is true even though the endpoint used to import or upload a file returns a successful response.
To run code when a file finishes processing successfully, listen for the File Ready event. To run code when a file's import fails, listen for the File Failed event.
externalInfo
The Import File, Bulk Import File, Generate File Upload URL, and Generate File Resumable Upload URL methods have a parameter called externalInfo
.
Arguments specified in this parameter are included in the event bodies of the File Ready and File Failed events. This is the only place they appear.
Use externalInfo
to send information to the events that isn't contained in the file descriptor object.
externalInfo
use caseHere is a sample flow to show how you could use externalInfo
effectively.
There is a form on a site that sends site visitors a confirmation email with the details they submitted in the form. One of the form fields is an image URL. In the email, we want to send a Wix download URL for the image, not the original image URL. This means we can only send the email when the image file is ready to download.
To implement this, we use the following flow:
id
.externalInfo
parameter as follows:
{
"externalInfo": {
"origin": "formBuilder",
"externalIds": ["id"]
}
}
externalInfo.origin
is formBuilder
. We don't want to run this code if media was added from a different source.id
to retrieve the form details from the CMS.A file's ID is its unique identifier. It is a read-only property.
It's good practice to save all of a file's properties in your code when you retrieve them.
There are several endpoints that include fileId
in their response:
There are several functions that accept a file ID, or an array of file IDs, as a parameter. The parameter is called fileId
, fileIds
, or file.id
.
In addition to the file ID, these parameters accept the file's Wix media URL. For example, wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032
.
This is useful when using other Wix APIs, such as Wix Data, that return a media file's Wix media URL, not its ID. For example, if you are retrieving a CMS collection that contains an image field, the image files' IDs aren't returned but their Wix media URLs are returned.
Private files are protected against public access. This means you can't access them using their file descriptor's url
property.
You may want to make a file private if it's for sale or contains personal information.
File descriptors for private files still include a top-level thumbnailUrl
property. For images and videos this is based on the file's contents. For other media types, it contains an icon representing the file type.
You can make a file private by specifying its private
property as true
when you add it to a site using one of the following methods:
Note: Making a file private impacts the following file descriptor properties:
yourFile.url
: Has a URL value, but it returns a 403 (unauthorized) response, meaning it won't work.yourFile.media.video.resolutions.url
yourFile.media.audio.assets[X].url
yourFile.media.document.url
yourFile.media.archive.url
yourFile.media.image.image.url
Use Generate File Download Url to access a private file. Call the method with your private file's ID. This will respond with a new URL that you can use to download the file.
This article demonstrates how to use the uploadUrl
response from Generate File Upload Url to upload a file to a site's Media Manager.
Note: Due to limits on the size and duration of files that you can upload, we recommend using Import File. See Wix Media: Supported Media File Types and File Sizes for more details.
This method uses the upload token included in the URL for authorization. No additional authorization is needed.
PUT {{generateFileUploadUrlResponse.uploadUrl}}
Name | Type | Optional | Description |
---|---|---|---|
Content-Type | string | no | File content type. For example, "image/jpeg" for a jpg file. |
Note: You can use the standard File API to retrieve the file content type using the File or Blob type
attributes.
You can also use external libraries, such as file-type, to retrieve the file content type.
Name | Type | Optional | Description |
---|---|---|---|
filename | string | no | File name that appears in the media manager. Include the file's extension in the name to prevent potential errors. |
Note: In case of failure due to incorrect mimeType
, include the file's extension in the filename
parameter and set the Content-Type
to 'application/octet-stream'. Doing this allows Wix servers to detect the correct content type of the file.
Notes:
axios
to make an API call, but you can use any HTTP client that allows a payload of binary data.
To learn how to install npm packages like axios
, see Work with npm Packages in the Editor.import mime from "mime-types";
import httpClient from "axios";
import { files } from "@wix/media";
/**
* @param uploadUrl Result of the GenerateFileUploadUrl API call.
* @param fileContent File content. You can load the file content using:
* - `fs.createReadStream('path_to_file')`
* - `fs.readFileSync('path_to_file')
* - Any other method that creates a supported type of the http client for file upload.
* @param mimeType File mimeType.
* @param fileName File name as it appears in a site's Media Manager.
*/
async function uploadMyFile(
uploadUrl: string,
fileContent: Buffer | ArrayBuffer | fs.ReadStream,
mimeType: string,
fileName: string,
) {
const params = { filename: fileName };
const headers = {
"Content-Type": mimeType,
};
const uploadResponse = await httpClient.put(uploadUrl, fileContent, {
headers,
params,
});
return uploadResponse;
}
const filePath = "bicycles.jpg";
const mimeType = mime.lookup(filePath); // This library looks at the file extension to retrieve the mime type.
const fileContent = fs.readFileSync("bicycles.jpg");
const uploadUrl = (await files.generateFileUploadUrl("bicycles.jpg", mimeType))
.uploadUrl;
const updateResponse = await uploadMyFile(
uploadUrl,
fileContent,
mimeType,
"3 bicycles in a storefront.jpg",
);
Note: Receiving a successful response does not indicate that the upload is complete. To run code when the upload finishes, listen for the File Ready and File Failed events. Learn more about knowing when a file is ready.
{
"file": {
"id": "2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"displayName": "file.jpg",
"url": "https://static.wixstatic.com/media/2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"parentFolderId": "media-root",
"hash": "cf96f0567ed967f02bc9580ab8db86be",
"sizeInBytes": "15359",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"url": "https://static.wixstatic.com/media/2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"height": 226,
"width": 370,
"filename": "myfilename.jpg",
"sizeInBytes": "15359"
},
"faces": []
}
},
"operationStatus": "READY",
"thumbnailUrl": "https://static.wixstatic.com/media/2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"labels": [],
"createdDate": "2022-09-11T15:13:24.000Z",
"updatedDate": "2022-09-11T15:13:24.000Z"
}
}
The response will include an HTTP status code.
This article demonstrates how to use the response object from Generate File Resumable Upload Url to upload a file to a site's Media Manager.
Note: Due to limits on the size and duration of files that you can upload, we recommend using Import File. See Wix Media: Supported Media File Types and File Sizes for more details.
This method uses the uploadToken
from the response for authorization.
No additional authorization is needed.
PUT {{generateFileResumableUploadUrlResponse.uploadUrl}}/{{generateFileResumableUploadUrlResponse.uploadToken}}
Name | Type | Optional | Description |
---|---|---|---|
filename | string | no | File name that appears in the Media Manager. Include the file's extension in the name to prevent potential errors. |
In this example we use tus-js-client to implement a resumable upload using the TUS protocol.
async function resumableFileUpload(
resumableUploadUrlResponse: GenerateFileResumableUploadUrlResponse,
mimeType: string,
): Upload {
// Get the file content to upload.
const fileName = "imageExample.jpg";
const fileContent = await fs.createReadStream(
path.join(__dirname, "..", "files", fileName),
);
const params = {
filename: fileName,
contentType: mimeType,
token: resumableUploadUrlResponse.uploadToken,
};
// Wrap the resumable upload session in a promise to wait for the upload to finish.
await new Promise(async (resolve, reject) => {
// Create a new TUS upload.
const upload = new tus.Upload(fileContent, {
// Use the uploadUrl from the response of the generate URL endpoint.
endpoint: resumableUploadUrlResponse.uploadUrl,
// Enable tus-js-client to automatically retry on errors.
retryDelays: [0, 3000, 5000, 10000, 20000],
// TSend parameters to the upload server to indentify the file and authentication token.
metadata: {
filename: fileName,
contentType: mimeType,
token: resumableUploadUrlResponse.uploadToken,
},
// Callback for errors that can't be fixed using retries.
onError: function (error) {
console.log("Failed because: " + error);
reject(error);
},
// Callback for reporting upload progress.
onProgress: function (bytesUploaded, bytesTotal) {
var percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2);
console.log(bytesUploaded, bytesTotal, percentage + "%");
},
// Callback for once the upload is completed.
onSuccess: function () {
console.log("Download %s from %s", fileName, upload.url);
resolve(true);
},
});
upload.start();
});
// PUT request to finalize the upload.
// Note that we concatenate the URL and token of the resumable upload response.
const result = await httpClient.put(
`${resumableUploadUrlResponse.uploadUrl}/${resumableUploadUrlResponse.uploadToken}`,
{},
{ params: { filename: fileName } },
);
}
Note: Receiving a successful response does not indicate that the upload is complete. To run code when the upload finishes, listen for the File Ready and File Failed events. Learn more about knowing when a file is ready.
{
"file": {
"id": "2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"displayName": "file.jpg",
"url": "https://static.wixstatic.com/media/2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"parentFolderId": "media-root",
"hash": "cf96f0567ed967f02bc9580ab8db86be",
"sizeInBytes": "15359",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"url": "https://static.wixstatic.com/media/2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"height": 226,
"width": 370,
"filename": "file.jpg",
"sizeInBytes": "15359"
},
"faces": []
}
},
"operationStatus": "READY",
"thumbnailUrl": "https://static.wixstatic.com/media/2acbb8_86485e224dd84143ba2f228777217bb7~mv2.jpeg",
"labels": [],
"createdDate": "2022-09-11T15:13:24.000Z",
"updatedDate": "2022-09-11T15:13:24.000Z"
}
}
The response will include an HTTP status code.
Docs for File in Media
File ID. Generated when a file is uploaded to the Media Manager.
File name as it appears in the Media Manager.
Static URL of the file.
ID of the file's parent folder.
File hash.
Size of the uploaded file in bytes.
Media file type.
Media file content.
Status of the file that was uploaded.
FAILED
: The file failed to upload, for example, during media post processing.READY
: The file uploaded, finished all processing, and is ready for use.PENDING
: The file is processing and the URLs are not yet available. This response is returned when importing a file.URL where the file was uploaded from.
URL of the file's thumbnail.
Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.
Date and time the file was created.
Date and time the file was updated.
The Wix site ID where the media file is stored.
State of the file.
{
"id": "2acbb8_66ffafe2e5d04335b968dc73dae5585c~mv2.jpg",
"displayName": "17893305044257194.jpg",
"url": "https://static.wixstatic.com/media/2acbb8_66ffafe2e5d04335b968dc73dae5585c~mv2.jpg",
"parentFolderId": "0c237d681c214835a0b6817a83460281",
"hash": "1742551494ee41965db67606e92eea7b",
"sizeInBytes": "543594",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "2acbb8_66ffafe2e5d04335b968dc73dae5585c~mv2.jpg",
"url": "https://static.wixstatic.com/media/2acbb8_66ffafe2e5d04335b968dc73dae5585c~mv2.jpg",
"height": 1440,
"width": 1440,
"altText": null,
"urlExpirationDate": null,
"filename": "17893305044257194.jpg",
"sizeInBytes": "543594"
},
"colors": {
"prominent": {
"hex": null,
"rgb": {
"r": 59,
"g": 64,
"b": 48
}
},
"palette": [
{
"hex": null,
"rgb": {
"r": 48,
"g": 51,
"b": 34
}
},
{
"hex": null,
"rgb": {
"r": 208,
"g": 215,
"b": 220
}
},
{
"hex": null,
"rgb": {
"r": 170,
"g": 189,
"b": 187
}
},
{
"hex": null,
"rgb": {
"r": 143,
"g": 157,
"b": 183
}
},
{
"hex": null,
"rgb": {
"r": 148,
"g": 145,
"b": 116
}
},
{
"hex": null,
"rgb": {
"r": 112,
"g": 133,
"b": 100
}
},
{
"hex": null,
"rgb": {
"r": 96,
"g": 103,
"b": 118
}
},
{
"hex": null,
"rgb": {
"r": 188,
"g": 132,
"b": 116
}
}
]
},
"faces": [],
"previewImage": null
}
},
"operationStatus": "READY",
"sourceUrl": "https://scontent-ort2-1.cdninstagram.com/v/t51.29350-15/241700103_1062935620882008_1337643828921346293_n.jpg?_nc_cat=111&ccb=1-7&_nc_sid=8ae9d6&_nc_ohc=Wc_iebXyc7kAX935kvF&_nc_ht=scontent-ort2-1.cdninstagram.com&edm=ANQ71j8EAAAA&oh=00_AT_mgdZ83wBehP3EiHBnfHV_Zrx0ocXiwVoIim7DyKhpoQ&oe=631361E2",
"thumbnailUrl": "https://static.wixstatic.com/media/2acbb8_66ffafe2e5d04335b968dc73dae5585c~mv2.jpg",
"labels": [],
"createdDate": "2022-08-30T17:17:52Z",
"updatedDate": "2022-08-30T17:17:52Z",
"state": "OK"
}
Generates a URL for downloading a compressed file containing specific files in the Media Manager.
The compressed file can contain up to 1000 files.
To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint. Since this is a permanent URL, it is less secure. Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
You can only call this method when authenticated as a Wix app or Wix user identity.
URL for downloading the compressed file containing the specified files in the Media Manager.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/generate-download-url' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"fileIds": ["4acbb8_7596aeebcf5c41eca01c0d99667ac967.mp3", "3vcbb7_7446aeebcf5c41eca01c0d99665bc866.mp3"]
}'
{
"downloadUrl": "https://archive.wixmp.com/archive/wix/7d332530d35c465aa4a0e71d1737909d"
}
Generates one or more temporary URLs for downloading a specific file in the Media Manager.
To download different assets of the file, specify the assetKeys
parameter which generates a download URL for each asset.
If no assetKey
is specified, it defaults to src
, which generates one download URL in the original file's format and quality.
Call this endpoint to grant external clients access to a private media file. Specify the expirationInMinutes
parameter to set the URL expiration time, and the expirationRedirectUrl
parameter to add a redirect url when the URL expires.
To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint. Since this is a permanent URL, it is less secure. Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
You can only call this method when authenticated as a Wix app or Wix user identity.
Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type.
Note: The name that appears in the Media Manager is taken from the filename
parameter in the Generate File Upload Url call.
The time that it takes in minutes for the download URL to expire.
Default: 600
.
Limit: 525600
(1 year).
The redirect URL for when the temporary download URL with a token expires.
Default: A 403 Forbidden response page.
Keys for downloading different assets (format and quality) of a file.
Default: src
, key representing the original file's format and quality.
Whether the link downloads the file or opens the file in the browser.
ATTACHMENT
: The link downloads the file.INLINE
: The link opens the file in the browser.Default: ATTACHMENT
URL for downloading a specific file in the Media Manager.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/generate-file-download-url' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"fileId": "4acbb8_7596aeebcf5c41eca01c0d99667ac967.mp3",
"downloadFileName": "Gorillaz - Feel Good Inc.mp3",
"expirationInMinutes": "60",
"expirationRedirectUrl":"www.mysite.com/store",
"assetKeys": ["320kbs.mp3"]
}'
{
"downloadUrls": [
{
"url": "https://download-files.wixmp.com/media/4acbb8_00668eb74c164439951039ca3a2ae54a~mv2_d_6031_4456_s_4_2.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ1cm46YXBwOmU2NjYzMGU3MTRmMDQ5MGFhZWExZjE0OWIzYjY5ZTMyIiwic3ViIjoidXJuOmFwcDplNjY2MzBlNzE0ZjA0OTBhYWVhMWYxNDliM2I2OWUzMiIsImF1ZCI6WyJ1cm46c2VydmljZTpmaWxlLmRvd25sb2FkIl0sImlhdCI6MTY1MjY0OTY4MCwiZXhwIjoxNjUyNjQ5NzUwLCJqdGkiOiJlODk0MDEzOTJmYzUiLCJvYmoiOltbeyJwYXRoIjoiL21lZGlhLzJhY2JiOF8wMDY2OGViNzRjMTY0NDM5OTUxMDM5Y2EzYTJhZTU0YX5tdjJfZF82MDMxXzQ0NTZfc180XzIuanBnIn1dXSwicmVkIjoid3d3Lmdvb2dsZS5jb20iLCJhdHRhY2htZW50Ijp7ImZpbGVuYW1lIjoiZWxpcmFuLmpwZyJ9fQ.P9eCCRunJcjxdFyJVOqFwvuutpyjRekAuP67BFBs8Es",
"assetKey": "320kbs.mp3"
}
]
}
There is 1 error with this status code:
See the entire list and learn more about Wix errors.
Gets information about a specific file in the Media Manager.
You can only call this method when authenticated as a Wix app or Wix user identity.
File ID.
You can also specify the file's Wix media URL. For example, wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032
.
Learn more about the file ID parameter (SDK | REST).
If you are working in REST, note that you must encode the Wix media URL to specify it as a query param because it contains special characters. For example, wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032
becomes wix%3Aimage%3A%2F%2Fv1%2F0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg%2Fleon.jpg%23originWidth%3D3024%26originHeight%3D4032
.
Information about the file.
curl -X GET \
'https://www.wixapis.com/site-media/v1/files/get-file-by-id?fileId=4acbb8_5646ee01a5524905af4f2e7c567cbbce' \
-H 'Authorization: <AUTH>'
{
"file": {
"id": "4acbb8_5646ee01a5524905af4f2e7c567cbbce",
"displayName": "sample-mpg-file.mpg",
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/file",
"parentFolderId": "media-root",
"hash": "6f9dad8f467c579269d96fdb4f7c95cd",
"sizeInBytes": "5918720",
"private": false,
"mediaType": "VIDEO",
"media": {
"video": {
"id": "4acbb8_5646ee01a5524905af4f2e7c567cbbce",
"resolutions": [
{
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/240p/mp4/file.mp4",
"height": 240,
"width": 320,
"poster": null,
"format": "mp4",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": "240p",
"filename": null
},
{
"url": "https://files.wix.com/site/media/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/bee66e94-91b6-4ff2-b0b8-236c95361027/repackage/hls",
"height": 0,
"width": 0,
"poster": null,
"format": "hls",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": null,
"filename": null
},
{
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/storyboard/144p/mp4/file.mp4",
"height": 144,
"width": 192,
"poster": null,
"format": "mp4",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": "144p",
"filename": null
}
],
"filename": "sample-mpg-file.mpg",
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/file",
"posters": [
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef000.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef001.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef002.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef003.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
}
],
"sizeInBytes": "5918720",
"urlExpirationDate": null
}
},
"operationStatus": "READY",
"sourceUrl": null,
"thumbnailUrl": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef002.jpg",
"labels": [],
"createdDate": "2022-08-21T15:39:09Z",
"updatedDate": "2022-08-21T15:39:21Z",
"state": "OK"
}
}
There is 1 error with this status code:
See the entire list and learn more about Wix errors.
Gets information about specific files in the Media Manager.
You can only call this method when authenticated as a Wix app or Wix user identity.
Information about the requested files.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/get-files' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"fileIds": ["4acbb8_7596aeebcf5c41eca01c0d99667ac967.mp3", "3vcbb7_7446aeebcf5c41eca01c0d99665bc866.mp3"]
}'
{
"files": [
{
"id": "4acbb8_5646ee01a5524905af4f2e7c567cbbce",
"displayName": "sample-mpg-file.mpg",
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/file",
"parentFolderId": "media-root",
"hash": "6f9dad8f467c579269d96fdb4f7c95cd",
"sizeInBytes": "5918720",
"private": false,
"mediaType": "VIDEO",
"media": {
"video": {
"id": "4acbb8_5646ee01a5524905af4f2e7c567cbbce",
"resolutions": [
{
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/240p/mp4/file.mp4",
"height": 240,
"width": 320,
"poster": null,
"format": "mp4",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": "240p",
"filename": null
},
{
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/storyboard/144p/mp4/file.mp4",
"height": 144,
"width": 192,
"poster": null,
"format": "mp4",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": "144p",
"filename": null
}
],
"filename": "sample-mpg-file.mpg",
"url": "https://video.wixstatic.com/video/4acbb8_5646ee01a5524905af4f2e7c567cbbce/file",
"posters": [
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef000.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef001.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef003.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
}
],
"sizeInBytes": "5918720",
"urlExpirationDate": null
}
},
"operationStatus": "READY",
"sourceUrl": null,
"thumbnailUrl": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef002.jpg",
"labels": [],
"createdDate": "2022-08-21T15:39:09Z",
"updatedDate": "2022-08-21T15:39:21Z",
"state": "OK"
},
{
"id": "3vcbb7_7446aeebcf5c41eca01c0d99665bc866",
"displayName": "sample-mpg-file.mpg",
"url": "https://video.wixstatic.com/video/3vcbb7_7446aeebcf5c41eca01c0d99665bc866/file",
"parentFolderId": "media-root",
"hash": "6f9dad8f467c579269d96fdb4f7c95cd",
"sizeInBytes": "5918720",
"private": false,
"mediaType": "VIDEO",
"media": {
"video": {
"id": "3vcbb7_7446aeebcf5c41eca01c0d99665bc866",
"resolutions": [
{
"url": "https://video.wixstatic.com/video/3vcbb7_7446aeebcf5c41eca01c0d99665bc866/240p/mp4/file.mp4",
"height": 240,
"width": 320,
"poster": null,
"format": "mp4",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": "240p",
"filename": null
},
{
"url": "https://video.wixstatic.com/video/3vcbb7_7446aeebcf5c41eca01c0d99665bc866/storyboard/144p/mp4/file.mp4",
"height": 144,
"width": 192,
"poster": null,
"format": "mp4",
"urlExpirationDate": null,
"sizeInBytes": null,
"quality": "144p",
"filename": null
}
],
"filename": "sample-mpg-file.mpg",
"url": "https://video.wixstatic.com/video/3vcbb7_7446aeebcf5c41eca01c0d99665bc866/file",
"posters": [
{
"id": "",
"url": "https://static.wixstatic.com/media/3vcbb7_7446aeebcf5c41eca01c0d99665bc866.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/3vcbb7_7446aeebcf5c41eca01c0d99665bc866.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
},
{
"id": "",
"url": "https://static.wixstatic.com/media/4acbb8_5646ee01a5524905af4f2e7c567cbbcef003.jpg",
"height": 240,
"width": 320,
"altText": null,
"urlExpirationDate": null,
"filename": null,
"sizeInBytes": null
}
],
"sizeInBytes": "5918720",
"urlExpirationDate": null
}
},
"operationStatus": "READY",
"sourceUrl": null,
"thumbnailUrl": "https://static.wixstatic.com/media/3vcbb7_7446aeebcf5c41eca01c0d99665bc866.jpg",
"labels": [],
"createdDate": "2022-08-21T15:39:09Z",
"updatedDate": "2022-08-21T15:39:21Z",
"state": "OK"
}
]
}
There is 1 error with this status code:
See the entire list and learn more about Wix errors.
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:
See the entire list and learn more about Wix errors.
Generates an upload URL to allow external clients to upload a file to the Media Manager.
To learn how external clients can use the generated upload URL in the response to upload a file to the Media Manager, see Upload API (SDK | REST).
Notes:
You can only call this method when authenticated as a Wix app or Wix user identity.
File mime type.
Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type.
Note: The name that appears in the Media Manager is taken from the filename
parameter in the Generate File Upload Url call.
ID of the file's parent folder.
This folder is the path root for the filePath
.
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.
A place to map an external entity to an uploaded file in the Wix Media Manager.
Path to the folder where the file will be stored.
For example, /videos/2024/december
.
If parentFolderId
is defined, the parent folder is used as the path root. Otherwise, the root is media-root
.
The folders in the path will be created if they don't already exist.
The URL for uploading a file to the Media Manager.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/generate-upload-url' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"mimeType": "image/jpeg",
"fileName": "T-shirt.jpg",
"sizeInBytes": "2608831"
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"labels": ["AMS:external_file_id", "woman", "bicycle"]
}'
{
"uploadUrl": "https://upload.wixmp.com/upload/bnfhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJ2MWI2ZjkzOS03YWExLTQxMTgtOGY3ZS03ZTRjOWJkYTk4YzgiLCJhdWQiOiJ1cm46c2VydmljZTp1cGxvYWQiLCJpc3MiOiJ1cm46c2VydmljZTp1cGxv6WQiLCJleHAiOjE2NjIwNTQ5OTMsImlhdCI6MTY2MTk2ODU4MywiYnVja2V0IjoidXBsb2FkLXRtcC13aXhtcC1jZGZjMzg0ZjE1ODQxYWFhNWVhYjE2YjEiLCJwYXRoIjoibWVkaWEvMmFjYmI4X2VmMDMwOTU0YjZmYjQ4ZWViMmQ4ZDJkYzYwNTEwZThjfm12Mi5qcGciLCJjYWxsYmFja1VybCI6Imh0dHBzOi8vd2l4bXAtY2RmYzM4NGYxNTg0MWFhYTVlYWIxNmIxLmFwcHNwb3QuY29tL19hcGkvdjMvdXBsb2FkL2NhbGxiYWNrP3VwbG9hZFRva2VuPWV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVekkxTmlKOS5leUpwYzNNaU9pSjFjbTQ2YzJWeWRtbGpaVHBtYVd4bExuVndiRzloWkNJc0ltRjFaQ0k2SW5WeWJqcHpaWEoyYVdObE9tWnBiR1V1ZFhCc2IyRmtJaXdpYzNWaUlqb2lkWEp1T21Gd2NEcGxOalkyTXpCbE56RTBaakEwT1RCaFlXVmhNV1l4TkRsaU0ySTJPV1V6TWlJc0ltbGhkQ0k2TVRZMk1UazJPRFU0TXl3aVpYaHdJam94TmpZeU1ERXhOemd6TENKcWRHa2lPaUkzT1RKa09EZzBOalEzTm1ZaUxDSmlhM1FpT2lKemRHRjBhV011ZDJsNGMzUmhkR2xqTG1OdmJTSXNJbkIwYUNJNklpOXRaV1JwWVM4eVlXTmlZamhmWldZd016QTVOVFJpTm1aaU5EaGxaV0l5WkRoa01tUmpOakExTVRCbE9HTi1iWFl5TG1wd1p5SXNJbUZqYkNJNkluQjFZbXhwWXlJc0lteG1ZeUk2Ym5Wc2JDd2lZMnhpSWpwN0luVnliQ0k2SW1oMGRIQnpPaTh2ZDJsNGNISnBkbUYwWlcxbFpHbGhMbUZ3Y0hOd2IzUXVZMjl0TDNZekwyMXdMMlpwYkdWekwzVndiRzloWkM5dFpXUnBZUzh5WVdOaVlqaGZaV1l3TXpBNU5UUmlObVppTkRobFpXSXlaRGhrTW1Sak5qQTFNVEJsT0dOLWJYWXlMbXB3WnlJc0ltRjBkR0ZqYUcxbGJuUWlPbnNpY0dGMGFDSTZJaTl0WldScFlTOHlZV05pWWpoZlpXWXdNekE1TlRSaU5tWmlORGhsWldJeVpEaGtNbVJqTmpBMU1UQmxPR04tYlhZeUxtcHdaeUlzSW5Wd2JHOWhaRjkwYjJ0bGJpSTZJa0pNYkZadFNDMTBWVTQzYVdoSFFqTlBiRWRLU25wVVZtVnlWakIwT1hadmJIRTNjM3BWUm5GeWFqTklia3BLV2s1dE0wWkNRekZqT1Y5cGVtOVhMVnBTZVRoM00xaDBaMng2ZEZVMGJDMVFkRlowYVRVemVXbGhUalpTU1dGUmIzbGFPVmRJU1VaT09EUjZiV2xDUVd4U09IRkRWMjlGWVdnNVdubFVaVTFxYkhCZlRVVkdiM0ZzUkVKRFdFZElUV05OV2xWamMxcGhha3N3WjFGRE4wTkZTa0ZrYUU5a1ZsWjVObEZDVUhwaFdYVkNNbEkwYTBORlpERXdhbGRvUjNOM2JWa3RkblZNVlVkNFdIVjBValoyYWxWb2NUWjFiV0pXT1V4WWRWVTFabUZ1ZFRWZlFsSmxWVkYxWTBGUFMzUXpVblJ3VTFwSVZrRnBXVmROUlZOemNuRXdhelE1ZWtoalowSjJRVXhTTUZWTGQxaE9XV1poTmpWUU1ISTFOa2N5TjAxd1ZFTXRVRms1V1hkT1ozbzRWMUJKVWpoSU1tRnNOMXBLYXpWSlpXdEpNRkF4VFdoSk5reENjVUZtU1ZKdFkyOWZVbTF4ZUVoa1dVcGtia2d4ZDIxTlNrTTRjbG95UlZsMFNUZDRVelpVT0dFMWRsRmpaVk53VW5oMU9URTFYMEYyT1ZaM1pXaHhUbWR6ZHpkSVZVaE1SVlpwWVV0ZmRsOVlZMmsxWTJNeVNFMURRbTFTT0hNOUluMHNJbWhsWVdSbGNuTWlPbTUxYkd3c0luQmhjM04wYUhKdmRXZG9JanAwY25WbGZYMC5WNWV4TndIdTAtXzltYzhMMUtYTUItdFRUVE9WS2czZTZnbnVSQlNtcThFIiwiYWNsIjoicHVibGljIiwibWltZVR5cGUiOiJpbWFnZS9qcGVnIn0.Z-R2i-w9YzBH4vkkP3RjaXaqj-QPnu-cyvQd5h_oTyE"
}
There are 5 errors with this status code:
See the entire list and learn more about Wix errors.
Generates a resumable upload URL to allow external clients to easily upload large files over 10MB to the Media Manager.
With the resumable upload URL, any interruptions in the upload process pauses the file upload, and resumes the file upload process after the interruption. The resumable upload URL is also helpful when network connection is poor. To learn how external clients can use the generated upload URL in the response to upload large files to the Media Manager, see Resumable Upload API (SDK | REST).
You can only call this method when authenticated as a Wix app or Wix user identity.
File mime type.
Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type.
Note: The name that appears in the Media Manager is taken from the filename
parameter in the Generate File Upload Url call.
ID of the file's parent folder.
This folder is the path root for the filePath
.
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.
The upload protocol to use for implementing the resumable upload.
Path to the folder where the file will be stored.
For example, /videos/2024/december
.
If parentFolderId
is defined, the parent folder is used as the path root. Otherwise, the root is media-root
.
The folders in the path will be created if they don't already exist.
The upload protocol to use for implementing the resumable upload.
The URL for uploading a file to the Media Manager.
Single-use upload token.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/generate-resumable-upload-url' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"mimeType": "image/jpeg",
"fileName": "T-shirt",
"sizeInBytes": "2608831"
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"uploadProtocol": "TUS"
}'
{
"uploadToken": "bnfhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2OTljMTY0ZC0yNjUwLTQ3YTAtYjUyNy0wZWU0YjAyYTk2NmIiLCJhdWQiOiJ1cm46c2VydmljZTp1cGxvYWQiLCJpc3MiOiJ1cm46c2VydmljZTp1cGxvYWQiLCJleHAiOjE2NjE3OTI2NDIsImlhdCI6MTY2MTE4NzgzMiwiYnVja2V0IjoidXBsb2FkLXRtcC13aXhtcC1jZGZjMzg0ZjE1ODQxYWFhNWVhYjE2YjEiLCJwYXRoIjoibWVkaWEvNDAwMjc2XzM3NjI4Mzc0YmVhMTRkZDI4NWNhYjJlNDUzYTlmMGYwfm12Mi5qcGciLCJjYWxsYmFja1VybCI6Imh0dHBzOi8vd2l4bXAtY2RmYzM4NGYxNTg0MWFhYTVlYWIxNmIxLmFwcHNwb3QuY29tL19hcGkvdjMvdXBsb2FkL2NhbGxiYWNrP3VwbG9hZFRva2VuPWV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVekkxTmlKOS5leUpwYzNNaU9pSjFjbTQ2YzJWeWRtbGpaVHBtYVd4bExuVndiRzloWkNJc0ltRjFaQ0k2SW5WeWJqcHpaWEoyYVdObE9tWnBiR1V1ZFhCc2IyRmtJaXdpYzNWaUlqb2lkWEp1T21Gd2NEcGxOalkyTXpCbE56RTBaakEwT1RCaFlXVmhNV1l4TkRsaU0ySTJPV1V6TWlJc0ltbGhkQ0k2TVRZMk1URTROemd6TWl3aVpYaHdJam94TmpZeE1qTXhNRE15TENKcWRHa2lPaUkzTURNNFlUaGlObUptTnpVaUxDSmlhM1FpT2lKemRHRjBhV011ZDJsNGMzUmhkR2xqTG1OdmJTSXNJbkIwYUNJNklpOXRaV1JwWVM4ME1EQXlOelpmTXpjMk1qZ3pOelJpWldFeE5HUmtNamcxWTJGaU1tVTBOVE5oT1dZd1pqQi1iWFl5TG1wd1p5SXNJbUZqYkNJNkluQjFZbXhwWXlJc0lteG1ZeUk2Ym5Wc2JDd2lZMnhpSWpwN0luVnliQ0k2SW1oMGRIQnpPaTh2ZDJsNGNISnBkbUYwWlcxbFpHbGhMbUZ3Y0hOd2IzUXVZMjl0TDNZekwyMXdMMlpwYkdWekwzVndiRzloWkM5dFpXUnBZUzgwTURBeU56WmZNemMyTWpnek56UmlaV0V4TkdSa01qZzFZMkZpTW1VME5UTmhPV1l3WmpCLWJYWXlMbXB3WnlJc0ltRjBkR0ZqYUcxbGJuUWlPbnNpY0dGMGFDSTZJaTl0WldScFlTODBNREF5TnpaZk16YzJNamd6TnpSaVpXRXhOR1JrTWpnMVkyRmlNbVUwTlROaE9XWXdaakItYlhZeUxtcHdaeUlzSW5Wd2JHOWhaRjkwYjJ0bGJpSTZJa0pNYkZadFNDMTBWVTQzYVdoSFFqTlBiRWRLU25wVVZtVnlWakIwT1hadmJIRTNjM3BWUm5GeWFqTklia3BLV2s1dE0wWkNRekZqT1Y5cGVtOVhMVnBTZVRoM00xaDBaMng2ZEZVMGJDMVFkRlowYVRVemVXbGhUalpTU1dGUmIzbGFPVmRJU1VaT09EUjZiV2xDUVd4U09IRkRWMjlGWVdnNVdubFVaVTFxYkhWMFRtdGlORFJVVWpKSFppMXdVMVU1Y0c5TGVucHdjMDFMWDB4RWRtNVlURnBYV1VwS2QwOVJkV3A1VUZKUmNYZENlR1Z2WmxsWmFIVnBWRWhaTWt4RU5HSllSbXMzYWtFNFJHNWtMVjlZUVhWU1NXSnJiVEpyUnpnM04wcGhTVWRpY0VaNVQwd3lVbXgyZVY5SFNrSXhYMFp3ZUVkb2VtOXRlbU4zVVdkSGNqSmxTVU5oV1RKaFNFVmFXWFpWTVhaNE5GaDFXR1ZvYjJwcGNXbFlNR1JMTUc4M2NVSnJPVFpzV1hvNGJsQkZZMEZvTWpSdlJXeDZObmRqVFRoVFNqQlNUM1JDWDA5cFVrbENhSFphVmpoa1pEZEpTSHAzU1hsdlZVbzRhVkZRYXpkc2FUZHljVFV5ZWxwNmNXcFRSMDVLV0hOMldFdGhZeTFuTW1GVk4zSmZMWHBSTW1GcE1qZFVUa1YxT1d0ZlVVUnpOMjB6VjNZNE5GaDBkVjh3UTFNMFlXd3pNVVJETVhwTVVIWjBNRVpKUW1GdFRtdHBOVFpMWkhCcVRtOXRkRTl3WnpaTE9FMVZhRkJ3U1ZWSVpXTjFMVTF3ZW1SSFptdGphalUxTkd4VWVXcFBUMTlRU1d4RFFUUlVVR3M0ZDA5QldtNWtUM1p5T0hReVEzQkxJbjBzSW1obFlXUmxjbk1pT201MWJHd3NJbkJoYzNOMGFISnZkV2RvSWpwMGNuVmxmWDAuZ2Z4b19vWGFFQ3JNWjNvbVdFaVBVZVdDQWpGTGlXRnNXdXZRNmdZelpUTSIsImFjbCI6InB1YmxpYyIsInByb3RvY29sIjoidHVzIiwibWltZVR5cGUiOiJpbWFnZS9qcGVnIiwic2Vzc2lvblVSTCI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3VwbG9hZC9zdG9yYWdlL3YxL2IvdXBsb2FkLXRtcC13aXhtcC1jZGZjMzg0ZjE1ODQxYWFhNWVhYjE2YjEvbz9wcmVkZWZpbmVkQWNsPXB1YmxpY1JlYWRcdTAwMjZwcm9qZWN0aW9uPWZ1bGxcdTAwMjZ1cGxvYWRUeXBlPXJlc3VtYWJsZVx1MDAyNnVwbG9hZF9pZD1BRFB5Y2R2TnlvRTVhQ05rLWx2UGtZR01Ib0pWeUxQV0F2V0s3TXlhbXIwRHVDQUxIT2FlU2p1emZnVWpCMVp3UGhZRGg4XzdxeTVncFNnVlhjRUZFMGlWd2t4YmNRIn0.Fq3U6_ogjXdHXpBLZ1rZOz7NF_r9PHPNlG_R2jVqNQY",
"uploadUrl": "https://upload.wixmp.com/upload/tus",
"uploadProtocol": "TUS"
}
There are 4 errors with this status code:
See the entire list and learn more about Wix errors.
Imports a file to the Media Manager using an external url.
Returns information about the imported file.
Specify the parentFolderId
and filePath
parameters to specify which folder you want the file to be imported to.
If no folder is specified, the file is imported to the media-root
folder.
Notes:
To import a file, you need to do one of the following:
mimeType
field of the request. For example, mimeType: 'image/jpeg'
.displayName
or url
field of the request. For example, displayName: 'Example Image.jpeg
or url: https://www.example.com/image.jpeg
.Note: If you want to validate the media type, specify the file's expected media type in the optional mediaType
field of the request. For example, mediaType: 'IMAGE'
.
You can only call this method when authenticated as a Wix app or Wix user identity.
Publicly accessible external file URL.
Media type of the file to import. excluding: OTHER media type
File name that appears in the Media Manager.
ID of the file's parent folder.
This folder is the path root for the filePath
.
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.
File mime type.
Optional parameters that should be sent with the external URL.
Optional headers that should be sent with the external URL.
Path to the folder where the file will be stored.
For example, /videos/2024/december
.
If parentFolderId
is defined, the parent folder is used as the path root. Otherwise, the root is media-root
.
The folders in the path will be created if they don't already exist.
Information about the imported file.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/import' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-binary '{
"mimeType": "image/jpeg",
"displayName": "T-shirt",
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
}'
{
"file": {
"id": "4acbb8_f968336b3fea4cbebc056d5c41f9944d~mv2.png",
"displayName": "T-shirt.png",
"url": "https://static.wixstatic.com/media/4acbb8_f968336b3fea3cbebc056d5c41f9944d~mv2.png",
"parentFolderId": "25284aa06584441ea94338fdcfbaba12",
"hash": "",
"sizeInBytes": "7108",
"private": false,
"mediaType": "IMAGE",
"media": null,
"operationStatus": "PENDING",
"sourceUrl": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png",
"thumbnailUrl": "https://static.wixstatic.com/media/4acbb8_f968336b3f4a4cbebc056d5c41f9944d~mv2.png",
"labels": [],
"createdDate": "2022-08-31T18:20:37Z",
"updatedDate": "2022-08-31T18:20:37Z",
"state": "OK"
}
}
There is 1 error with this status code:
See the entire list and learn more about Wix errors.
This method has been replaced with Bulk Import File, and will be removed on March 31, 2024.
Imports a bulk of files to the Media Manager using external urls.
Deprecation Notice:
This endpoint has been replaced with Bulk Import File and will be removed on March 31, 2024.
Returns information about the imported files.
Use the parentFolderId
and filePath
parameters to specify the folder you want each file to be imported to.
If no folder is specified, the file is imported to the media-root
folder.
Notes:
To import files, you need to do one of the following for each file:
mimeType
field of the request. For example, mimeType: 'image/jpeg'
.displayName
or url
field of the request. For example, displayName: 'Example Image.jpeg
or url: https://www.example.com/image.jpeg
.Note: If you want to validate the media type, specify the file's expected media type in the optional mediaType
field of the request. For example, mediaType: 'IMAGE'
.
You can only call this method when authenticated as a Wix app or Wix user identity.
Information about the files to import.
Information about the imported files.
curl -X POST \
'https://www.wixapis.com/site-media/v1/bulk/files/import' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-binary '{
"importFileRequests": [{
"mimeType": "image/jpeg",
"displayName": "T-shirt",
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
},
"mimeType": "video/mp4",
"displayName": "[Pants]",
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"url": "https://www.google.com/videos/branding/googlelogo.mp4"
}]
}'
{
"files": [
{
"id": "8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"displayName": "T-shirt",
"url": "https://static.wixstatic.com/media/8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"parentFolderId": "25284aa06584441ea94338fdcfbaba12",
"hash": "",
"sizeInBytes": "7108",
"private": false,
"mediaType": "IMAGE",
"operationStatus": "PENDING",
"sourceUrl": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png",
"thumbnailUrl": "https://static.wixstatic.com/media/8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"labels": [],
"createdDate": "2023-02-21T11:25:21.000Z",
"updatedDate": "2023-02-21T11:25:21.000Z",
"siteId": "051597ab-b0e3-442d-82eb-e956e541e544",
"state": "OK"
},
{
"id": "426eeb_666f012f9cb4ca9b5cf2b8fc7c62143~mv2.png",
"displayName": "Pants",
"url": "https://static.wixstatic.com/media/426eeb_666f012f9cb4ca9b5cf2b8fc7c62143.mp4",
"parentFolderId": "25284aa06584441ea94338fdcfbaba12",
"hash": "",
"sizeInBytes": "7108",
"private": false,
"mediaType": "VIDEO",
"operationStatus": "PENDING",
"sourceUrl": "https://www.google.com/videos/branding/googlelogo.mp4",
"thumbnailUrl": "https://static.wixstatic.com/media/426eeb_666f012f9cb4ca9b5cf2b8fc7c62143~mv2.mp4",
"labels": [],
"createdDate": "2023-02-21T11:25:21.200Z",
"updatedDate": "2023-02-21T11:25:21.200Z",
"siteId": "051597ab-b0e3-442d-82eb-e956e541e544",
"state": "OK"
}
]
}
Imports a bulk of files to the Media Manager using external urls.
Returns information about the imported files.
Specify the parentFolderId
and filePath
parameters to specify the folder you want each file to be imported to.
If no folder is specified, the file is imported to the media-root
folder.
Notes:
To import files, you need to do one of the following for each file:
mimeType
field of the request. For example, mimeType: 'image/jpeg'
.displayName
or url
field of the request. For example, displayName: 'Example Image.jpeg
or url: https://www.example.com/image.jpeg
.Note: If you want to validate the media type, specify the file's expected media type in the optional mediaType
field of the request. For example, mediaType: 'IMAGE'
.
You can only call this method when authenticated as a Wix app or Wix user identity.
Information about the files to import.
Default: true
Items created by bulk action.
Bulk action metadata.
curl -X POST \
'https://www.wixapis.com/site-media/v1/bulk/files/import-v2' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-binary '{
"importFileRequests": [{
"mimeType": "image/jpeg",
"displayName": "T-shirt",
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
},
"mimeType": "video/mp45",
"displayName": "[Pants]",
"parentFolderId":"25284aa06584441ea94338fdcfbaba12",
"private": false,
"url": "https://www.google.com/videos/branding/googlelogo"
}]
}'
{
"results": [
{
"item": {
"id": "8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"displayName": "T-shirt",
"url": "https://static.wixstatic.com/media/8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"parentFolderId": "25284aa06584441ea94338fdcfbaba12",
"hash": "",
"sizeInBytes": "7108",
"private": false,
"mediaType": "IMAGE",
"operationStatus": "PENDING",
"sourceUrl": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png",
"thumbnailUrl": "https://static.wixstatic.com/media/8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"labels": [],
"createdDate": "2023-02-21T11:25:21.000Z",
"updatedDate": "2023-02-21T11:25:21.000Z",
"siteId": "051597ab-b0e3-442d-82eb-e956e541e544",
"state": "OK"
},
"itemMetadata": {
"id": "8b7eef_66f012f9facb4ca9b5cf2b8fc7c5933e~mv2.png",
"originalIndex": 0,
"success": true
}
},
{
"item": {
"id": "426eeb_666f012f9cb4ca9b5cf2b8fc7c62143~mv2.png",
"displayName": "Pants",
"url": "https://static.wixstatic.com/media/426eeb_666f012f9cb4ca9b5cf2b8fc7c62143.mp4",
"parentFolderId": "25284aa06584441ea94338fdcfbaba12",
"hash": "",
"sizeInBytes": "7108",
"private": false,
"mediaType": "VIDEO",
"operationStatus": "PENDING",
"sourceUrl": "https://www.google.com/videos/branding/googlelogo.mp4",
"thumbnailUrl": "https://static.wixstatic.com/media/426eeb_666f012f9cb4ca9b5cf2b8fc7c62143~mv2.mp4",
"labels": [],
"createdDate": "2023-02-21T11:25:21.200Z",
"updatedDate": "2023-02-21T11:25:21.200Z",
"siteId": "051597ab-b0e3-442d-82eb-e956e541e544",
"state": "OK"
},
"itemMetadata": {
"id": "https://www.google.com/videos/branding/googlelogo",
"originalIndex": 1,
"success": false,
"error": {
"code": "UNSUPPORTED_FILE_FORMAT",
"description": "Requested file type is unrecognized or is not supported",
"data": {
"internalCode": "-7751",
"internalMessage": "Not allowed file extension .md for media_type undetected",
"internalKey": "wpm_error.unsupported_file_extension"
}
}
}
}
],
"bulkActionMetadata": {
"totalSuccesses": 1,
"totalFailures": 1,
"undetailedFailures": 0
}
}
Retrieves a list of files in the Media Manager.
To retrieve a list of files within a specific folder in the Media Manager, specify the folder's ID in the parentFolderId
parameter. If no folder is specified, the method retrieves the list of files in the root folder of the Media Manager.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the file's parent folder.
Default:media-root
.
File media type.
Name of the field to sort by.
Sort order.
Maximum number of items to return in the results.
Pointer to the next or previous page in the list of results.
Pass the relevant cursor token from the pagingMetadata
object in the previous call's response.
Not relevant for the first request.
List of files in the Media Manager.
The next cursor if it exists.
This example sorts by updatedDate
in DESC
order with a paging limit of 2.
curl -X GET \
'https://www.wixapis.com/site-media/v1/files?parentFolderId=25284aa06584441ea94338fdcfbaba12&sort.fieldName=updateDate&mediaTypes=IMAGE&sort.order=DESC&paging.limit=2' \
-H 'Authorization: <AUTH>'
{
"files": [
{
"createdDate": "2022-06-06T12:45:29.000Z",
"displayName": "space.jpg",
"hash": "df55f859485ab04453e6afacf259ac98",
"id": "6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg",
"labels": [
"Brown",
"Spiral galaxy",
"Atmosphere",
"Nebula",
"Milky way",
"Galaxy",
"Atmospheric phenomenon",
"Astronomical object",
"Science",
"Star"
],
"media": {
"image": {
"colors": {
"palette": [
{
"rgb": {
"b": 28,
"g": 28,
"r": 25
}
},
{
"rgb": {
"b": 156,
"g": 163,
"r": 163
}
},
{
"rgb": {
"b": 111,
"g": 111,
"r": 107
}
},
{
"rgb": {
"b": 152,
"g": 150,
"r": 136
}
},
{
"rgb": {
"b": 90,
"g": 87,
"r": 73
}
},
{
"rgb": {
"b": 149,
"g": 138,
"r": 124
}
},
{
"rgb": {
"b": 85,
"g": 74,
"r": 66
}
},
{
"rgb": {
"b": 46,
"g": 63,
"r": 160
}
}
],
"prominent": {
"rgb": {
"b": 31,
"g": 30,
"r": 26
}
}
},
"faces": [
{
"confidence": 0.9979932308197021,
"height": 64,
"width": 46,
"x": 50,
"y": 5
}
],
"image": {
"filename": "space.jpg",
"height": 4456,
"id": "6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg",
"sizeInBytes": "2608831",
"url": "https://static.wixstatic.com/media/6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg",
"width": 6031
},
"previewImage": {
"height": 591,
"id": "image.preview",
"url": "https://static.wixstatic.com/media/6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg",
"width": 800
}
}
},
"mediaType": "IMAGE",
"operationStatus": "READY",
"parentFolderId": "media-root",
"private": true,
"sizeInBytes": "2608831",
"thumbnailUrl": "https://static.wixstatic.com/media/6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg",
"updatedDate": "2022-06-06T12:45:29.000Z",
"url": "https://static.wixstatic.com/media/6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg",
"state": "OK",
"url": "https://static.wixstatic.com/media/6acbb8_7a7bd9193ffc4130ab8ff74f5dcedf8a~mv2.jpg"
},
{
"createdDate": "2021-07-06T12:28:20.000Z",
"displayName": "astronaut.jpg",
"hash": "bf65f859485ab04453e6afacf259ac03",
"id": "4b5bb8_7a7bd9193ffc4130ab8ff74f5dcedf97~mv2.jpg",
"labels": [
"Black",
"Straight galaxy",
"Air",
"UFO",
"Stars",
"Universe",
"Bold",
"Human",
"Science",
"Saturn"
],
"media": {
"image": {
"colors": {
"palette": [
{
"rgb": {
"b": 28,
"g": 28,
"r": 25
}
},
{
"rgb": {
"b": 156,
"g": 163,
"r": 163
}
},
{
"rgb": {
"b": 222,
"g": 111,
"r": 17
}
},
{
"rgb": {
"b": 12,
"g": 150,
"r": 16
}
},
{
"rgb": {
"b": 9,
"g": 7,
"r": 73
}
},
{
"rgb": {
"b": 149,
"g": 18,
"r": 122
}
},
{
"rgb": {
"b": 25,
"g": 74,
"r": 66
}
},
{
"rgb": {
"b": 46,
"g": 23,
"r": 10
}
}
],
"prominent": {
"rgb": {
"b": 31,
"g": 10,
"r": 26
}
}
},
"faces": [
{
"confidence": 0.9979932308197021,
"height": 64,
"width": 6,
"x": 50,
"y": 5
}
],
"image": {
"filename": "astronaut.jpg",
"height": 2956,
"id": "4b5bb8_7a7bd9193ffc4130ab8ff74f5dcedf97.jpg",
"sizeInBytes": "2508841",
"url": "https://static.wixstatic.com/media/4b5bb8_7a7bd9193ffc4130ab8ff74f5dcedf97~mv2.jpg",
"width": 3031
},
"previewImage": {
"height": 201,
"id": "image.preview",
"url": "https://static.wixstatic.com/media/4b5bb8_7a7bd9193ffc4130ab8ff74f5dcedf97~mv2.jpg",
"width": 400
}
}
},
"mediaType": "IMAGE",
"operationStatus": "READY",
"parentFolderId": "media-root",
"private": true,
"sizeInBytes": "2508841",
"thumbnailUrl": "https://static.wixstatic.com/media/4b5bb8_7a7bd9193ffc4130ab8ff74f5dcedf97~mv2.jpg",
"updatedDate": "2022-06-06T12:45:29.000Z",
"url": "https://static.wixstatic.com/media/4b5bb8_7a7bd9193ffc4130ab8ff74f5dcedf97~mv2.jpg",
"state": "OK"
}
],
"nextCursor": {
"cursors": {
"next": ""
},
"hasNext": false
}
}
There are 2 errors with this status code:
See the entire list and learn more about Wix errors.
Searches all folders in the Media Manager and returns a list of files that match the terms specified in the parameters.
If no parameters are specified, the endpoint returns all files in the MEDIA_ROOT
folder.
You can only call this method when authenticated as a Wix app or Wix user identity.
Term to search for. Possible terms include the value of a file's
displayName
, mimeType
, and label
.
For example, if a file's label is cat, the search term is 'cat'.
A root folder in the media manager to search in.
Default: MEDIA_ROOT
.
File media type.
Field name and order to sort by. One of:
displayName
updatedDate
sizeInBytes
Default: updatedDate
in desc
order.Cursor and paging information.
Files matching the query.
The next cursor if it exists.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/search' \
-H 'Authorization: <AUTH>'
--data-binary '{
"search": "building",
"rootFolder": "MEDIA_ROOT",
"sort": {
"fieldName": "displayName",
"order": "DESC"
}
}'
{
"files": [
{
"id": "6acbb7_0e146875eea04f10bf3d1b217c113e3d~mv2.jpg",
"displayName": "Facade of a municipal building after renovation.jpg",
"url": "https://static.wixstatic.com/media/6acbb7_0e146875eea04f10bf3d1b217c113e3d~mv2.jpg",
"parentFolderId": "purchased-items",
"hash": "5b50adc9d85bf256c5148cbe81ea4e57",
"sizeInBytes": "2595863",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "6acbb7_0e146875eea04f10bf3d1b217c113e3d~mv2.jpg",
"url": "https://static.wixstatic.com/media/6acbb7_0e146875eea04f10bf3d1b217c113e3d~mv2.jpg",
"height": 1667,
"width": 2500,
"altText": null,
"urlExpirationDate": null,
"filename": "Facade of a municipal building after renovation.jpg",
"sizeInBytes": "2595863"
},
"colors": {
"prominent": {
"hex": null,
"rgb": {
"r": 203,
"g": 201,
"b": 200
}
},
"palette": [
{
"hex": null,
"rgb": {
"r": 53,
"g": 49,
"b": 36
}
},
{
"hex": null,
"rgb": {
"r": 213,
"g": 217,
"b": 222
}
},
{
"hex": null,
"rgb": {
"r": 183,
"g": 139,
"b": 67
}
},
{
"hex": null,
"rgb": {
"r": 101,
"g": 70,
"b": 55
}
},
{
"hex": null,
"rgb": {
"r": 118,
"g": 119,
"b": 121
}
},
{
"hex": null,
"rgb": {
"r": 159,
"g": 128,
"b": 123
}
},
{
"hex": null,
"rgb": {
"r": 220,
"g": 178,
"b": 113
}
},
{
"hex": null,
"rgb": {
"r": 153,
"g": 160,
"b": 165
}
}
]
},
"faces": [],
"previewImage": null
}
},
"operationStatus": "READY",
"sourceUrl": "https://download.shutterstock.com/gatekeeper/W3siZCI6ICJzaHV0dGVyc3RvY2stbWVkaWEiLCAiayI6ICJwaG90by8yMTUzMTU2MzUzL2h1Z2UuanBnIiwgImUiOiAxNjU0OTQzMTY2LCAiZGMiOiAiaWRsXzIxNTMxNTYzNTMiLCAibSI6IDF9LCAic3Q5ZnJpRkVrNmIzU0Juejc3c2RKTEk2eXFRIl0=/shutterstock_2153156353.jpg",
"thumbnailUrl": "https://static.wixstatic.com/media/2acbb7_0e146875eea04f10bf3d1b217c113e3d~mv2.jpg",
"labels": [
"Sky",
"Cloud",
"Building",
"Window",
"Plant",
"Stairs",
"Urban design",
"Condominium",
"Tree",
"Wall"
],
"createdDate": "2022-06-01T10:26:29Z",
"updatedDate": "2022-06-01T10:26:29Z",
"siteId": "bee66e94-91b6-4ff2-b0b8-236c95361027",
"state": "OK",
"internalTags": ["_paid", "_shutterstock", "_shutterstock_2153156353"]
},
{
"id": "8244_2e146875eea04f10bf3d1b217c113e9v7~mv2.jpg",
"displayName": "A new building.jpg",
"url": "https://static.wixstatic.com/media/8244_2e146875eea04f10bf3d1b217c113e9v7~mv2.jpg",
"parentFolderId": "purchased-items",
"hash": "",
"sizeInBytes": "2595863",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "8244_2e146875eea04f10bf3d1b217c113e9v7~mv2.jpg",
"url": "https://static.wixstatic.com/media/8244_2e146875eea04f10bf3d1b217c113e9v7~mv2.jpg",
"height": 1022,
"width": 1500,
"altText": null,
"urlExpirationDate": null,
"filename": "A new building.jpg",
"sizeInBytes": "2595863"
},
"colors": {
"prominent": {
"hex": null,
"rgb": {
"r": 113,
"g": 101,
"b": 20
}
},
"palette": [
{
"hex": null,
"rgb": {
"r": 13,
"g": 43,
"b": 36
}
},
{
"hex": null,
"rgb": {
"r": 213,
"g": 217,
"b": 222
}
},
{
"hex": null,
"rgb": {
"r": 183,
"g": 139,
"b": 67
}
},
{
"hex": null,
"rgb": {
"r": 101,
"g": 70,
"b": 55
}
},
{
"hex": null,
"rgb": {
"r": 118,
"g": 119,
"b": 121
}
},
{
"hex": null,
"rgb": {
"r": 159,
"g": 128,
"b": 123
}
},
{
"hex": null,
"rgb": {
"r": 220,
"g": 178,
"b": 113
}
},
{
"hex": null,
"rgb": {
"r": 153,
"g": 160,
"b": 165
}
}
]
},
"faces": [],
"previewImage": null
}
},
"operationStatus": "READY",
"sourceUrl": "https://download.shutterstock.com/gatekeeper/W3siZCI6ICJzaHV0dGVyc3RvY2stbWVkaWEiLCAiayI6ICJwaG90by8yMTUzMTU2MzUzL2h1Z2UuanBnIiwgImUiOiAxNjU0OTQzMTY2LCAiZGMiOiAiaWRsXzIxNTMxNTYzNTMiLCAibSI6IDF9LCAic3Q5ZnJpRkVrNmIzU0Juejc3c2RKTEk2eXFRIl0=/shutterstock_2153156353.jpg",
"thumbnailUrl": "https://static.wixstatic.com/media/8244_2e146875eea04f10bf3d1b217c113e9v7~mv2.jpg",
"labels": [
"Sky",
"Cloud",
"Building",
"Porch",
"Window",
"Stairs",
"Urban design",
"Apartment",
"Grass",
"Wall"
],
"createdDate": "2022-06-01T10:26:29Z",
"updatedDate": "2022-06-01T10:26:29Z",
"siteId": "bee66e94-91b6-4ff2-b0b8-236c95361027",
"state": "OK"
}
],
"nextCursor": {
"cursors": {
"next": ""
},
"hasNext": false
}
}
There are 2 errors with this status code:
See the entire list and learn more about Wix errors.
Generates a URL for streaming a specific video file in the Media Manager.
To stream different assets of the file, specify the assetKeys
parameter which generates a video streaming URL for each asset. If no assetKey is specified, it defaults to src
, which generates one video streaming URL in the original file's format and quality.
You can only call this method when authenticated as a Wix app or Wix user identity.
URL for streaming a specific file in the Media Manager.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/generate-video-stream-url' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"fileId": "4acbb8_b1403cfa28c24a8091597de4d2b518b9",
"format": "HLS"
}'
{
"downloadUrl": {
"url": "https://repackager.wixmp.com/video.wixstatic.com/video/4acbb8_b1403cfa28c24a8091597de4d2b518b9/,720p,480p,/mp4/file.mp4.urlset/master.m3u8",
"assetKey": "720p.mp4"
}
}
Deletes the specified files from the Media Manager.
The deleted files are moved to the Media Manager's trash bin (TRASH-ROOT
folder) unless permanently deleted. To permanently delete files, specify the permanent
parameter with the value true
. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.
Note the following:
You can only call this method when authenticated as a Wix app or Wix user identity.
Whether the specified files are permanently deleted.
Default: false
curl -X POST \
'https://www.wixapis.com/site-media/v1/bulk/files/delete' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-binary '{
"fileIds": ["4acbb8_7596aeebcf5c41eca01c0d99667ac967.mp3", "3vcbb7_7446aeebcf5c41eca01c0d99665bc866.mp3"]
}'
{}
Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
You can only call this method when authenticated as a Wix app or Wix user identity.
curl -X POST \
'https://www.wixapis.com/site-media/v1/bulk/trash-bin/files/restore' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-binary '{
"fileIds": ["4acbb8_7596aeebcf5c41eca01c0d99667ac967.mp3", "3vcbb7_7446aeebcf5c41eca01c0d99665bc866.mp3"]
}'
{}
Retrieves a list of files in the Media Manager's trash bin.
Note: The Media Manager's trash bin (TRASH-ROOT
folder) only contains temporarily deleted files, not permanently deleted files.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the file's parent folder.
Default: media-root
.
File media type.
Name of the field to sort by.
Sort order.
Maximum number of items to return in the results.
Pointer to the next or previous page in the list of results.
Pass the relevant cursor token from the pagingMetadata
object in the previous call's response.
Not relevant for the first request.
List of files in the Media Manager's trash bin.
The next cursor if it exists.
This example sorts by updatedDate
in DESC
order with a paging limit of 2.
curl -X GET \
'https://www.wixapis.com/site-media/v1/trash-bin/files?sort.fieldName=updateDate&sort.order=DESC&paging.limit=2' \
-H 'Authorization: <AUTH>'
{
"files": [
{
"id": "229acbb8_5af267716b0d449c8c706bfdbf51d9d0.mp3",
"displayName": "01 - ES - Susanne Vega - Tom's Diner.mp3",
"url": "https://music.wixstatic.com/mp3/229acbb8_5af267716b0d449c8c706bfdbf51d9d9.mp3",
"parentFolderId": "trash-root",
"hash": "24bbee7b0f95258fb72e6e672fdb9f75",
"sizeInBytes": "5582258",
"private": false,
"mediaType": "AUDIO",
"media": {
"audio": {
"id": "229acbb8_5af267716b0d449c8c706bfdbf51d9d9.mp3",
"assets": [
{
"id": "",
"url": "https://music.wixstatic.com/mp3/229acbb8_5af267716b0d449c8c706bfdbf51d9d9.mp3",
"urlExpirationDate": null,
"sizeInBytes": null,
"filename": null,
"duration": 230164,
"private": false,
"assetKey": "320kbs.mp3",
"format": "mp3",
"quality": "320kbs"
}
],
"bitrate": 192000,
"format": "mp3",
"duration": 230164,
"sizeInBytes": "5582258"
}
},
"operationStatus": "READY",
"sourceUrl": null,
"thumbnailUrl": "https://static.wixstatic.com/media/bed4c36100699ce1870dafd75a05210a.png",
"labels": [],
"createdDate": "2023-01-14T13:12:52Z",
"updatedDate": "2023-01-14T13:12:52Z",
"siteId": "bee66e94-91b6-4ff2-b0b8-236c95361026",
"state": "OK",
"internalTags": ["_fileOrigin_uploaded"]
},
{
"id": "4ab999246f267716b0d449c8c706bfdbf51d4060.mp3",
"displayName": "04 - RS - Major Lazer - Lean On.mp3",
"url": "https://music.wixstatic.com/mp3/5acbb8_5af267716b0d449c8c706bfdbf51d9d9.mp3",
"parentFolderId": "trash-root",
"hash": "24bbee7b0f95258fb72e6e672fdb9f75",
"sizeInBytes": "5582258",
"private": false,
"mediaType": "AUDIO",
"media": {
"audio": {
"id": "5ab999246f267716b0d449c8c706bfdbf51d4060.mp3",
"assets": [
{
"id": "",
"url": "https://music.wixstatic.com/mp3/5ab999246f267716b0d449c8c706bfdbf51d4060.mp3",
"urlExpirationDate": null,
"sizeInBytes": null,
"filename": null,
"duration": 230164,
"private": false,
"assetKey": "320kbs.mp3",
"format": "mp3",
"quality": "320kbs"
}
],
"bitrate": 192000,
"format": "mp3",
"duration": 230164,
"sizeInBytes": "5582258"
}
},
"operationStatus": "READY",
"sourceUrl": null,
"thumbnailUrl": "https://static.wixstatic.com/media/bed4c36100699ce1870dafd75a05210a.png",
"labels": [],
"createdDate": "2022-10-11T13:32:52Z",
"updatedDate": "2022-10-11T13:32:52Z",
"siteId": "bee66e94-91b6-4ff2-b0b8-236c95361026",
"state": "OK"
}
],
"nextCursor": {
"cursors": {
"next": ""
},
"hasNext": false
}
}
There are 2 errors with this status code:
See the entire list and learn more about Wix errors.
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"
}
}
Triggered when a file is deleted.
If the movedToTrash
property in the event object true
, the file was moved to the Media Manager's trash bin. If the movedToTrash
property in the event object is false
, the file was permanently deleted.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor
.
Event name. Expected deleted
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.media.site_media.v1.file_descriptor_deleted",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "44bb8fd1-ee47-4673-9aez-26783569dcf3",
"entityFqdn": "wix.media.site_media.v1.file_descriptor",
"slug": "deleted",
"entityId": "8a7c1d_a8704d0436274f2e8fb8ad02b1e9417d~mv2.jpg",
"deletedEvent": {
"movedToTrash": true
},
"eventTime": "2023-01-05T14:06:11.408Z",
"triggeredByAnonymizeRequest": false
}
Triggered when a file fails during essential post-upload processing.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor
.
Event name. Expected file_failed
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.media.site_media.v1.file_descriptor_file_failed",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "c2f0051a-b534-47b1-aaae-219e47d49a6e",
"entityFqdn": "wix.media.site_media.v1.file_descriptor",
"slug": "file_failed",
"entityId": "a9a72e_89d5c6b222d248f4a7fb3fcec745c347~mv2.jpg",
"actionEvent": {
"body": {
"externalInfo": {
"origin": "MyAppId",
"externalIds": ["externalEntityId1"]
}
}
},
"eventTime": "2023-03-12T07:42:35.079Z",
"triggeredByAnonymizeRequest": false
}
Triggered when a file is ready to be used, after any post-upload processing.
This event is also triggred when a file is restored from the Media Manager's trash bin.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor
.
Event name. Expected file_ready
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.media.site_media.v1.file_descriptor_file_ready",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "72b9f179-e3db-4a6c-b93z-53d05a0e5b76",
"entityFqdn": "wix.media.site_media.v1.file_descriptor",
"slug": "file_ready",
"entityId": "033c14_581d63228a0346aaa42768dd15e74016~mv2.jpg",
"actionEvent": {
"body": {
"file": {
"id": "033c14_581d63228a0346aaa42768dd15e74016~mv2.jpg",
"displayName": "IMG-20230101-WA0060.jpg",
"url": "https://static.wixstatic.com/media/033c14_581d63228a0346aaa42768dd15e74016~mv2.jpg",
"parentFolderId": "media-root",
"hash": "8c7df429c37e1c4008bdfac8030afc81",
"sizeInBytes": "406103",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "033c14_581d63228a0346aaa42768dd15e74016~mv2.jpg",
"url": "https://static.wixstatic.com/media/033c14_581d63228a0346aaa42768dd15e74016~mv2.jpg",
"height": 2048,
"width": 1536,
"filename": "IMG-20230101-WA0060.jpg",
"sizeInBytes": "406103"
},
"colors": {
"prominent": {
"rgb": {
"r": 105,
"g": 104,
"b": 98
}
},
"palette": [
{
"rgb": {
"r": 97,
"g": 98,
"b": 93
}
},
{
"rgb": {
"r": 215,
"g": 208,
"b": 198
}
},
{
"rgb": {
"r": 28,
"g": 28,
"b": 26
}
},
{
"rgb": {
"r": 177,
"g": 182,
"b": 180
}
},
{
"rgb": {
"r": 161,
"g": 156,
"b": 145
}
},
{
"rgb": {
"r": 65,
"g": 56,
"b": 40
}
},
{
"rgb": {
"r": 58,
"g": 39,
"b": 26
}
},
{
"rgb": {
"r": 155,
"g": 164,
"b": 181
}
}
]
},
"faces": []
}
},
"operationStatus": "READY",
"thumbnailUrl": "https://static.wixstatic.com/media/033c14_581d63228a0346aaa42768dd15e74016~mv2.jpg",
"labels": [],
"createdDate": "2023-01-04T14:12:31.000Z",
"updatedDate": "2023-01-05T14:12:31.000Z",
"state": "OK"
},
"triggeredByUndelete": false,
"externalInfo": {
"origin": "MyAppId",
"externalIds": ["externalEntityId1"]
}
}
},
"eventTime": "2023-01-05T14:12:31.863Z",
"triggeredByAnonymizeRequest": false
}
Triggered when a file is updated, including when a file is moved to a different folder.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor
.
Event name. Expected updated
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.media.site_media.v1.file_descriptor_updated",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "686563e5-74ed-489a-88ee-b07d1657c18e",
"entityFqdn": "wix.media.site_media.v1.file_descriptor",
"slug": "updated",
"entityId": "002b27_c847a92bbf7e44c9916176478ef95c3d~mv2.jpg",
"updatedEvent": {
"currentEntity": {
"id": "002b27_c847a92bbf7e44c9916176478ef95c3d~mv2.jpg",
"displayName": "the great unknown",
"url": "https://static.wixstatic.com/media/002b27_c847a92bbf7e44c9916176478ef95c3d~mv2.jpg",
"parentFolderId": "media-root",
"hash": "e4d7c400523eb022737b17c70213ba7e",
"sizeInBytes": "46489",
"private": false,
"mediaType": "IMAGE",
"media": {
"image": {
"image": {
"id": "002b27_c847a92bbf7e44c9916176478ef95c3d~mv2.jpg",
"url": "https://static.wixstatic.com/media/002b27_c847a92bbf7e44c9916176478ef95c3d~mv2.jpg",
"height": 300,
"width": 960,
"filename": "the great unknown",
"sizeInBytes": "46489"
},
"colors": {},
"faces": []
}
},
"operationStatus": "READY",
"thumbnailUrl": "https://static.wixstatic.com/media/002b27_c847a92bbf7e44c9916176478ef95c3d~mv2.jpg",
"labels": [],
"createdDate": "2023-01-04T01:39:30.000Z",
"updatedDate": "2023-01-05T14:06:19.000Z",
"state": "OK"
}
},
"eventTime": "2023-01-05T14:06:19.730Z",
"triggeredByAnonymizeRequest": false
}