Introduction

The Files API allows you to manage files and generate file urls from a site's Media Manager.

With the Files API, you can:

Did this help?

Importing Files

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'.

Knowing when a file is ready

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.

Using 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 case

Here 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:

  1. When the site visitor submits the form, send the form information to a data collection, getting back the form data's id.
  2. Call Import File to upload the image to the Media Manager. Specify the externalInfo parameter as follows:
    Copy
    { "externalInfo": { "origin": "formBuilder", "externalIds": ["id"] } }
  3. Listen for the File Ready event and implement the following steps to handle it:
    1. Check that the value for externalInfo.origin is formBuilder. We don't want to run this code if media was added from a different source.
    2. Use the form data's id to retrieve the form details from the CMS.
    3. Generate a download URL for the image.
    4. Send the confirmation email with the form details and the download URL.
Did this help?

File ID

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:

File ID as a parameter

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.

Did this help?

Private Files

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.

Make your file private

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.
  • One of the following media URLs has a value of an empty string, depending on the type of file:
    • Video: yourFile.media.video.resolutions.url
    • Audio: yourFile.media.audio.assets[X].url
    • Document: yourFile.media.document.url
    • Archive: yourFile.media.archive.url
    • Image: yourFile.media.image.image.url

Access a private file

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.

Did this help?

Upload API

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.

Authorization

This method uses the upload token included in the URL for authorization. No additional authorization is needed.

Syntax

Copy
PUT {{generateFileUploadUrlResponse.uploadUrl}}

Headers Params

NameTypeOptionalDescription
Content-TypestringnoFile 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.

Query Params

NameTypeOptionalDescription
filenamestringnoFile 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.

Example

Notes:

  • This example is written in JavaScript and uses the SDK version of Generate File Upload Url. It displays the flow and order of API and function calls.
  • This example uses 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.

Request:

Copy
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.

Response

Copy
{ "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" } }

Status/Error Codes

The response will include an HTTP status code.

Did this help?

Resumable Upload API

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.

Authorization

This method uses the uploadToken from the response for authorization. No additional authorization is needed.

Syntax

Copy
PUT {{generateFileResumableUploadUrlResponse.uploadUrl}}/{{generateFileResumableUploadUrlResponse.uploadToken}}

Query Params

NameTypeOptionalDescription
filenamestringnoFile name that appears in the Media Manager. Include the file's extension in the name to prevent potential errors.

Example

Implement a Resumable Upload Client using TUS Protocol

In this example we use tus-js-client to implement a resumable upload using the TUS protocol.

Request

Copy
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.

Response

Copy
{ "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" } }

Status/Error Codes

The response will include an HTTP status code.

Did this help?

File Descriptor Object


Docs for File in Media

Properties
idstringRead-onlymaxLength 1000

File ID. Generated when a file is uploaded to the Media Manager.


displayNamestringmaxLength 200

File name as it appears in the Media Manager.


urlstringRead-onlyformat WEB_URL

Static URL of the file.


parentFolderIdstringmaxLength 100

ID of the file's parent folder.


hashstringRead-onlymaxLength 100

File hash.


sizeInBytesstringRead-onlyformat DECIMAL_VALUEdecimalValue {"maxScale":0}

Size of the uploaded file in bytes.


privatebooleanRead-only

Whether the file is public or private. Learn more about private files (SDK | REST).


mediaTypestringRead-only

Media file type.


mediaMediaRead-only

Media file content.


operationStatusstringRead-only

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.

sourceUrlstringRead-onlyformat WEB_URL

URL where the file was uploaded from.


thumbnailUrlstringRead-onlyformat WEB_URL

URL of the file's thumbnail.


labelsArray <string>maxItems 100maxLength 200

Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.


createdDatestringRead-onlyformat date-time

Date and time the file was created.


updatedDatestringRead-onlyformat date-time

Date and time the file was updated.


siteIdstringRead-onlymaxLength 100

The Wix site ID where the media file is stored.


statestringRead-only

State of the file.

FileDescriptor
JSON
{ "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" }
Did this help?

POST

Generate Files Download Url


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/generate-download-url

Body Params
fileIdsArray <string>RequiredminItems 1maxItems 1000maxLength 1000

IDs of the files to download.

You can also specify the files' Wix media URLs. For example, ["wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032"]. Learn more about the file ID parameter (SDK | REST).

Response Object
downloadUrlstringformat WEB_URL

URL for downloading the compressed file containing the specified files in the Media Manager.

Generate a URL for downloading a zip file containing the specified files
Request
cURL
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"] }'
Response
JSON
{ "downloadUrl": "https://archive.wixmp.com/archive/wix/7d332530d35c465aa4a0e71d1737909d" }
Did this help?

POST

Generate File Download Url


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/generate-file-download-url

Body Params
fileIdstringRequiredmaxLength 1000

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).


downloadFileNamestringmaxLength 100

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.


expirationInMinutesintegerminimum 1format int32

The time that it takes in minutes for the download URL to expire.
Default: 600.
Limit: 525600 (1 year).


expirationRedirectUrlstringformat WEB_URL

The redirect URL for when the temporary download URL with a token expires.
Default: A 403 Forbidden response page.


assetKeysArray <string>maxItems 100maxLength 100

Keys for downloading different assets (format and quality) of a file. Default: src, key representing the original file's format and quality.


contentDispositionstring

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

Response Object
downloadUrlsArray <DownloadUrl>maxItems 100

URL for downloading a specific file in the Media Manager.

Generate a URL for downloading a file
Request
cURL
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"] }'
Response
JSON
{ "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" } ] }
Errors
400Invalid Argument

There is 1 error with this status code:

See the entire list and learn more about Wix errors.

Did this help?

GET

Get File Descriptor


Gets information about a specific file in the Media Manager.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/site-media/v1/files/get-file-by-id

Query Params
fileIdstringRequired

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.

Response Object
fileFile

Information about the file.

Get information about a file
Request
cURL
curl -X GET \ 'https://www.wixapis.com/site-media/v1/files/get-file-by-id?fileId=4acbb8_5646ee01a5524905af4f2e7c567cbbce' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "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" } }
Errors
400Invalid Argument

There is 1 error with this status code:

See the entire list and learn more about Wix errors.

Did this help?

POST

Get File Descriptors


Gets information about specific files in the Media Manager.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/get-files

Body Params
fileIdsArray <string>RequiredminItems 1maxItems 100maxLength 1000

File IDs.

You can also specify the files' Wix media URLs. For example, ["wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032"]. Learn more about the file ID parameter (SDK | REST).

Response Object
filesArray <FileDescriptor>maxItems 100

Information about the requested files.

Get information about specific files
Request
cURL
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"] }'
Response
JSON
{ "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" } ] }
Errors
400Invalid Argument

There is 1 error with this status code:

See the entire list and learn more about Wix errors.

Did this help?

PATCH

Update File Descriptor


Updates a file.

Specify the parentFolderId parameter to move a file from its current folder to a different folder.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/site-media/v1/files/update-file-descriptor

Body Params
fileFileRequired

The file to update.

Response Object
fileFile

Information about the updated file.

Update a file
Request
cURL
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" ] } }'
Response
JSON
{ "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" } }
Errors
400Invalid Argument

There is 1 error with this status code:

See the entire list and learn more about Wix errors.

Event TriggersThis method triggers the following events:
Did this help?

POST

Generate File Upload Url


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:

  • When you upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready (SDK | REST).
  • Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, call Generate File Resumable Upload URL instead. With the resumable upload URL, any interruption in the upload process pauses the file upload, and resumes the file upload process after the interruption.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/generate-upload-url

Body Params
mimeTypestringRequiredmaxLength 100

File mime type.


fileNamestringmaxLength 200

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.


parentFolderIdstringmaxLength 100

ID of the file's parent folder.
This folder is the path root for the filePath.
Default: media-root.


privateboolean

Whether the file will be public or private. Learn more about private files (SDK | REST).


labelsArray <string>maxItems 50maxLength 200

Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.


externalInfoExternalInfo

A place to map an external entity to an uploaded file in the Wix Media Manager.


filePathstringmaxLength 100

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.

Response Object
uploadUrlstringformat WEB_URL

The URL for uploading a file to the Media Manager.

Generate an upload URL
Request
cURL
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"] }'
Response
JSON
{ "uploadUrl": "https://upload.wixmp.com/upload/bnfhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJ2MWI2ZjkzOS03YWExLTQxMTgtOGY3ZS03ZTRjOWJkYTk4YzgiLCJhdWQiOiJ1cm46c2VydmljZTp1cGxvYWQiLCJpc3MiOiJ1cm46c2VydmljZTp1cGxv6WQiLCJleHAiOjE2NjIwNTQ5OTMsImlhdCI6MTY2MTk2ODU4MywiYnVja2V0IjoidXBsb2FkLXRtcC13aXhtcC1jZGZjMzg0ZjE1ODQxYWFhNWVhYjE2YjEiLCJwYXRoIjoibWVkaWEvMmFjYmI4X2VmMDMwOTU0YjZmYjQ4ZWViMmQ4ZDJkYzYwNTEwZThjfm12Mi5qcGciLCJjYWxsYmFja1VybCI6Imh0dHBzOi8vd2l4bXAtY2RmYzM4NGYxNTg0MWFhYTVlYWIxNmIxLmFwcHNwb3QuY29tL19hcGkvdjMvdXBsb2FkL2NhbGxiYWNrP3VwbG9hZFRva2VuPWV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVekkxTmlKOS5leUpwYzNNaU9pSjFjbTQ2YzJWeWRtbGpaVHBtYVd4bExuVndiRzloWkNJc0ltRjFaQ0k2SW5WeWJqcHpaWEoyYVdObE9tWnBiR1V1ZFhCc2IyRmtJaXdpYzNWaUlqb2lkWEp1T21Gd2NEcGxOalkyTXpCbE56RTBaakEwT1RCaFlXVmhNV1l4TkRsaU0ySTJPV1V6TWlJc0ltbGhkQ0k2TVRZMk1UazJPRFU0TXl3aVpYaHdJam94TmpZeU1ERXhOemd6TENKcWRHa2lPaUkzT1RKa09EZzBOalEzTm1ZaUxDSmlhM1FpT2lKemRHRjBhV011ZDJsNGMzUmhkR2xqTG1OdmJTSXNJbkIwYUNJNklpOXRaV1JwWVM4eVlXTmlZamhmWldZd016QTVOVFJpTm1aaU5EaGxaV0l5WkRoa01tUmpOakExTVRCbE9HTi1iWFl5TG1wd1p5SXNJbUZqYkNJNkluQjFZbXhwWXlJc0lteG1ZeUk2Ym5Wc2JDd2lZMnhpSWpwN0luVnliQ0k2SW1oMGRIQnpPaTh2ZDJsNGNISnBkbUYwWlcxbFpHbGhMbUZ3Y0hOd2IzUXVZMjl0TDNZekwyMXdMMlpwYkdWekwzVndiRzloWkM5dFpXUnBZUzh5WVdOaVlqaGZaV1l3TXpBNU5UUmlObVppTkRobFpXSXlaRGhrTW1Sak5qQTFNVEJsT0dOLWJYWXlMbXB3WnlJc0ltRjBkR0ZqYUcxbGJuUWlPbnNpY0dGMGFDSTZJaTl0WldScFlTOHlZV05pWWpoZlpXWXdNekE1TlRSaU5tWmlORGhsWldJeVpEaGtNbVJqTmpBMU1UQmxPR04tYlhZeUxtcHdaeUlzSW5Wd2JHOWhaRjkwYjJ0bGJpSTZJa0pNYkZadFNDMTBWVTQzYVdoSFFqTlBiRWRLU25wVVZtVnlWakIwT1hadmJIRTNjM3BWUm5GeWFqTklia3BLV2s1dE0wWkNRekZqT1Y5cGVtOVhMVnBTZVRoM00xaDBaMng2ZEZVMGJDMVFkRlowYVRVemVXbGhUalpTU1dGUmIzbGFPVmRJU1VaT09EUjZiV2xDUVd4U09IRkRWMjlGWVdnNVdubFVaVTFxYkhCZlRVVkdiM0ZzUkVKRFdFZElUV05OV2xWamMxcGhha3N3WjFGRE4wTkZTa0ZrYUU5a1ZsWjVObEZDVUhwaFdYVkNNbEkwYTBORlpERXdhbGRvUjNOM2JWa3RkblZNVlVkNFdIVjBValoyYWxWb2NUWjFiV0pXT1V4WWRWVTFabUZ1ZFRWZlFsSmxWVkYxWTBGUFMzUXpVblJ3VTFwSVZrRnBXVmROUlZOemNuRXdhelE1ZWtoalowSjJRVXhTTUZWTGQxaE9XV1poTmpWUU1ISTFOa2N5TjAxd1ZFTXRVRms1V1hkT1ozbzRWMUJKVWpoSU1tRnNOMXBLYXpWSlpXdEpNRkF4VFdoSk5reENjVUZtU1ZKdFkyOWZVbTF4ZUVoa1dVcGtia2d4ZDIxTlNrTTRjbG95UlZsMFNUZDRVelpVT0dFMWRsRmpaVk53VW5oMU9URTFYMEYyT1ZaM1pXaHhUbWR6ZHpkSVZVaE1SVlpwWVV0ZmRsOVlZMmsxWTJNeVNFMURRbTFTT0hNOUluMHNJbWhsWVdSbGNuTWlPbTUxYkd3c0luQmhjM04wYUhKdmRXZG9JanAwY25WbGZYMC5WNWV4TndIdTAtXzltYzhMMUtYTUItdFRUVE9WS2czZTZnbnVSQlNtcThFIiwiYWNsIjoicHVibGljIiwibWltZVR5cGUiOiJpbWFnZS9qcGVnIn0.Z-R2i-w9YzBH4vkkP3RjaXaqj-QPnu-cyvQd5h_oTyE" }
Errors
400Invalid Argument

There are 5 errors with this status code:

See the entire list and learn more about Wix errors.

Did this help?

POST

Generate File Resumable Upload Url


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).

Note: When you upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready (SDK | REST).

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/generate-resumable-upload-url

Body Params
mimeTypestringRequiredmaxLength 100

File mime type.


fileNamestringmaxLength 200

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.


parentFolderIdstringmaxLength 100

ID of the file's parent folder.
This folder is the path root for the filePath.
Default: media-root.


privateboolean

Whether the file will be public or private. Learn more about private files (SDK | REST).


labelsArray <string>maxItems 500maxLength 200

Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.


uploadProtocolstring

The upload protocol to use for implementing the resumable upload.


filePathstringmaxLength 100

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.

Response Object
uploadProtocolstring

The upload protocol to use for implementing the resumable upload.


uploadUrlstringformat WEB_URL

The URL for uploading a file to the Media Manager.


uploadTokenstringmaxLength 2000

Single-use upload token.

Generate a resumable upload URL
Request
cURL
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" }'
Response
JSON
{ "uploadToken": "bnfhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2OTljMTY0ZC0yNjUwLTQ3YTAtYjUyNy0wZWU0YjAyYTk2NmIiLCJhdWQiOiJ1cm46c2VydmljZTp1cGxvYWQiLCJpc3MiOiJ1cm46c2VydmljZTp1cGxvYWQiLCJleHAiOjE2NjE3OTI2NDIsImlhdCI6MTY2MTE4NzgzMiwiYnVja2V0IjoidXBsb2FkLXRtcC13aXhtcC1jZGZjMzg0ZjE1ODQxYWFhNWVhYjE2YjEiLCJwYXRoIjoibWVkaWEvNDAwMjc2XzM3NjI4Mzc0YmVhMTRkZDI4NWNhYjJlNDUzYTlmMGYwfm12Mi5qcGciLCJjYWxsYmFja1VybCI6Imh0dHBzOi8vd2l4bXAtY2RmYzM4NGYxNTg0MWFhYTVlYWIxNmIxLmFwcHNwb3QuY29tL19hcGkvdjMvdXBsb2FkL2NhbGxiYWNrP3VwbG9hZFRva2VuPWV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVekkxTmlKOS5leUpwYzNNaU9pSjFjbTQ2YzJWeWRtbGpaVHBtYVd4bExuVndiRzloWkNJc0ltRjFaQ0k2SW5WeWJqcHpaWEoyYVdObE9tWnBiR1V1ZFhCc2IyRmtJaXdpYzNWaUlqb2lkWEp1T21Gd2NEcGxOalkyTXpCbE56RTBaakEwT1RCaFlXVmhNV1l4TkRsaU0ySTJPV1V6TWlJc0ltbGhkQ0k2TVRZMk1URTROemd6TWl3aVpYaHdJam94TmpZeE1qTXhNRE15TENKcWRHa2lPaUkzTURNNFlUaGlObUptTnpVaUxDSmlhM1FpT2lKemRHRjBhV011ZDJsNGMzUmhkR2xqTG1OdmJTSXNJbkIwYUNJNklpOXRaV1JwWVM4ME1EQXlOelpmTXpjMk1qZ3pOelJpWldFeE5HUmtNamcxWTJGaU1tVTBOVE5oT1dZd1pqQi1iWFl5TG1wd1p5SXNJbUZqYkNJNkluQjFZbXhwWXlJc0lteG1ZeUk2Ym5Wc2JDd2lZMnhpSWpwN0luVnliQ0k2SW1oMGRIQnpPaTh2ZDJsNGNISnBkbUYwWlcxbFpHbGhMbUZ3Y0hOd2IzUXVZMjl0TDNZekwyMXdMMlpwYkdWekwzVndiRzloWkM5dFpXUnBZUzgwTURBeU56WmZNemMyTWpnek56UmlaV0V4TkdSa01qZzFZMkZpTW1VME5UTmhPV1l3WmpCLWJYWXlMbXB3WnlJc0ltRjBkR0ZqYUcxbGJuUWlPbnNpY0dGMGFDSTZJaTl0WldScFlTODBNREF5TnpaZk16YzJNamd6TnpSaVpXRXhOR1JrTWpnMVkyRmlNbVUwTlROaE9XWXdaakItYlhZeUxtcHdaeUlzSW5Wd2JHOWhaRjkwYjJ0bGJpSTZJa0pNYkZadFNDMTBWVTQzYVdoSFFqTlBiRWRLU25wVVZtVnlWakIwT1hadmJIRTNjM3BWUm5GeWFqTklia3BLV2s1dE0wWkNRekZqT1Y5cGVtOVhMVnBTZVRoM00xaDBaMng2ZEZVMGJDMVFkRlowYVRVemVXbGhUalpTU1dGUmIzbGFPVmRJU1VaT09EUjZiV2xDUVd4U09IRkRWMjlGWVdnNVdubFVaVTFxYkhWMFRtdGlORFJVVWpKSFppMXdVMVU1Y0c5TGVucHdjMDFMWDB4RWRtNVlURnBYV1VwS2QwOVJkV3A1VUZKUmNYZENlR1Z2WmxsWmFIVnBWRWhaTWt4RU5HSllSbXMzYWtFNFJHNWtMVjlZUVhWU1NXSnJiVEpyUnpnM04wcGhTVWRpY0VaNVQwd3lVbXgyZVY5SFNrSXhYMFp3ZUVkb2VtOXRlbU4zVVdkSGNqSmxTVU5oV1RKaFNFVmFXWFpWTVhaNE5GaDFXR1ZvYjJwcGNXbFlNR1JMTUc4M2NVSnJPVFpzV1hvNGJsQkZZMEZvTWpSdlJXeDZObmRqVFRoVFNqQlNUM1JDWDA5cFVrbENhSFphVmpoa1pEZEpTSHAzU1hsdlZVbzRhVkZRYXpkc2FUZHljVFV5ZWxwNmNXcFRSMDVLV0hOMldFdGhZeTFuTW1GVk4zSmZMWHBSTW1GcE1qZFVUa1YxT1d0ZlVVUnpOMjB6VjNZNE5GaDBkVjh3UTFNMFlXd3pNVVJETVhwTVVIWjBNRVpKUW1GdFRtdHBOVFpMWkhCcVRtOXRkRTl3WnpaTE9FMVZhRkJ3U1ZWSVpXTjFMVTF3ZW1SSFptdGphalUxTkd4VWVXcFBUMTlRU1d4RFFUUlVVR3M0ZDA5QldtNWtUM1p5T0hReVEzQkxJbjBzSW1obFlXUmxjbk1pT201MWJHd3NJbkJoYzNOMGFISnZkV2RvSWpwMGNuVmxmWDAuZ2Z4b19vWGFFQ3JNWjNvbVdFaVBVZVdDQWpGTGlXRnNXdXZRNmdZelpUTSIsImFjbCI6InB1YmxpYyIsInByb3RvY29sIjoidHVzIiwibWltZVR5cGUiOiJpbWFnZS9qcGVnIiwic2Vzc2lvblVSTCI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3VwbG9hZC9zdG9yYWdlL3YxL2IvdXBsb2FkLXRtcC13aXhtcC1jZGZjMzg0ZjE1ODQxYWFhNWVhYjE2YjEvbz9wcmVkZWZpbmVkQWNsPXB1YmxpY1JlYWRcdTAwMjZwcm9qZWN0aW9uPWZ1bGxcdTAwMjZ1cGxvYWRUeXBlPXJlc3VtYWJsZVx1MDAyNnVwbG9hZF9pZD1BRFB5Y2R2TnlvRTVhQ05rLWx2UGtZR01Ib0pWeUxQV0F2V0s3TXlhbXIwRHVDQUxIT2FlU2p1emZnVWpCMVp3UGhZRGg4XzdxeTVncFNnVlhjRUZFMGlWd2t4YmNRIn0.Fq3U6_ogjXdHXpBLZ1rZOz7NF_r9PHPNlG_R2jVqNQY", "uploadUrl": "https://upload.wixmp.com/upload/tus", "uploadProtocol": "TUS" }
Errors
400Invalid Argument

There are 4 errors with this status code:

See the entire list and learn more about Wix errors.

Did this help?

POST

Import File


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:

  • The media property isn't returned in the files response object.
  • When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready (SDK | REST).

To import a file, you need to do one of the following:

  • Specify its MIME type in the mimeType field of the request. 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 request. For example, mediaType: 'IMAGE'.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/import

Body Params
urlstringRequiredformat WEB_URL

Publicly accessible external file URL.


mediaTypestring

Media type of the file to import. excluding: OTHER media type


displayNamestringmaxLength 200

File name that appears in the Media Manager.


parentFolderIdstringmaxLength 100

ID of the file's parent folder.
This folder is the path root for the filePath.
Default: media-root.


privateboolean

Whether the file will be public or private. Learn more about private files (SDK | REST).


labelsArray <string>maxItems 500maxLength 200

Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.


mimeTypestringmaxLength 100

File mime type.


externalInfoExternalInfo

Information sent to the File Ready and File Failed events. See Importing Files (SDK | REST) to learn more.


urlParamsstruct

Optional parameters that should be sent with the external URL.


urlHeadersstruct

Optional headers that should be sent with the external URL.


filePathstringmaxLength 100

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.

Response Object
fileFile

Information about the imported file.

Import a file using an external URL
Request
cURL
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" }'
Response
JSON
{ "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" } }
Errors
400Invalid Argument

There is 1 error with this status code:

See the entire list and learn more about Wix errors.

Event TriggersThis method triggers the following events:
Did this help?

POST

Bulk Import Files


Deprecated

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:

  • The media property isn't returned in the files response object.
  • When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready (SDK | REST).

To import files, you need to do one of the following for each file:

  • Specify its MIME type in the mimeType field of the request. For example, mimeType: 'image/jpeg'.
  • Include 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 request. For example, mediaType: 'IMAGE'.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/bulk/files/import

Body Params
importFileRequestsArray <ImportFileRequest>RequiredminItems 1maxItems 100

Information about the files to import.

Response Object
filesArray <FileDescriptor>maxItems 100

Information about the imported files.

Import files using external URLs
Request
cURL
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" }] }'
Response
JSON
{ "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" } ] }
Did this help?

POST

Bulk Import File


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:

  • The media property isn't returned in the files response object.
  • When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready (SDK | REST).

To import files, you need to do one of the following for each file:

  • Specify its MIME type in the mimeType field of the request. For example, mimeType: 'image/jpeg'.
  • Include 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 request. For example, mediaType: 'IMAGE'.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/bulk/files/import-v2

Body Params
importFileRequestsArray <ImportFileRequest>RequiredminItems 1maxItems 100

Information about the files to import.


returnEntityboolean

Default: true

Response Object
resultsArray <BulkImportFileResult>

Items created by bulk action.


bulkActionMetadataBulkActionMetadata

Bulk action metadata.

Import files using external URLs
Request
cURL
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" }] }'
Response
JSON
{ "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 } }
Event TriggersThis method triggers the following events:
Did this help?

GET

List Files


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/site-media/v1/files

Query Params
parentFolderIdstring

ID of the file's parent folder.
Default:media-root.


mediaTypesArray <string>

File media type.


privateboolean

\ntrue: Returns only private files. \nfalse: Returns only public files. \nundefined: Returns public and private files. \n Learn more about private files (SDK | REST).


sort.fieldNamestringmaxLength 512

Name of the field to sort by.


sort.orderstring

Sort order.


paging.limitintegerminimum 0maximum 100format int32

Maximum number of items to return in the results.


paging.cursorstring

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.

Response Object
filesArray <FileDescriptor>maxItems 200

List of files in the Media Manager.


nextCursorNextCursor

The next cursor if it exists.

List image files in a specific folder

This example sorts by updatedDate in DESC order with a paging limit of 2.

Request
cURL
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>'
Response
JSON
{ "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 } }
Errors
400Invalid Argument

There are 2 errors with this status code:

See the entire list and learn more about Wix errors.

Did this help?

POST

Search Files


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/search

Body Params
searchstringmaxLength 200

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'.


rootFolderstring

A root folder in the media manager to search in.
Default: MEDIA_ROOT.


mediaTypesArray <string>maxItems 30

File media type.


privateboolean

\ntrue: Returns only private files. \nfalse: Returns only public files. \nundefined: Returns public and private files. \n Learn more about private files (SDK | REST).


sortSort

Field name and order to sort by. One of:

  • displayName
  • updatedDate
  • sizeInBytes Default: updatedDate in desc order.

pagingPaging

Cursor and paging information.

Response Object
filesArray <FileDescriptor>maxItems 200

Files matching the query.


nextCursorNextCursor

The next cursor if it exists.

Search files
Request
cURL
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" } }'
Response
JSON
{ "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 } }
Errors
400Invalid Argument

There are 2 errors with this status code:

See the entire list and learn more about Wix errors.

Did this help?

POST

Generate Video Streaming Url


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/files/generate-video-stream-url

Body Params
fileIdstringRequiredmaxLength 1000

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).


formatstring

Video stream format.

Response Object
downloadUrlDownloadUrl

URL for streaming a specific file in the Media Manager.

Generate a URL for streaming a specific video file
Request
cURL
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" }'
Response
JSON
{ "downloadUrl": { "url": "https://repackager.wixmp.com/video.wixstatic.com/video/4acbb8_b1403cfa28c24a8091597de4d2b518b9/,720p,480p,/mp4/file.mp4.urlset/master.m3u8", "assetKey": "720p.mp4" } }
Did this help?

POST

Bulk Delete Files


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:

  • The specified files can be from different folders.
  • Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
  • Attempting to delete files that are already in the trash bin doesn't result in an error.
  • If a site contains deleted media files, the deleted media files still appear on the site as the files are still in the Media Manager (in the trash bin).
  • You can use Bulk Restore Files From Trash Bin to restore files from the Media Manager's trash bin.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/bulk/files/delete

Body Params
fileIdsArray <string>RequiredmaxItems 1000maxLength 1000

IDs of the files to move to the Media Manager's trash bin.

You can also specify the files' Wix media URLs. For example, ["wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032"]. Learn more about the file ID parameter (SDK | REST).


permanentboolean

Whether the specified files are permanently deleted.
Default: false

Response Object
Returns an empty object.
Bulk delete files
Request
cURL
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"] }'
Response
JSON
{}
Event TriggersThis method triggers the following events:
Did this help?

POST

Bulk Restore Files From Trash Bin


Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/site-media/v1/bulk/trash-bin/files/restore

Body Params
fileIdsArray <string>RequiredmaxItems 1000maxLength 1000

IDs of the files to restore from the Media Manager's trash bin.

You can also specify the files' Wix media URLs. For example, ["wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032"]. Learn more about the file ID parameter (SDK | REST).

Response Object
Returns an empty object.
Bulk restore deleted files
Request
cURL
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"] }'
Response
JSON
{}
Event TriggersThis method triggers the following events:
Did this help?

GET

List Deleted Files


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/site-media/v1/trash-bin/files

Query Params
parentFolderIdstring

ID of the file's parent folder.
Default: media-root.


mediaTypesArray <string>

File media type.


privateboolean

\ntrue: Returns only private files. \nfalse: Returns only public files. \nundefined: Returns public and private files. \n Learn more about private files (SDK | REST).


sort.fieldNamestringmaxLength 512

Name of the field to sort by.


sort.orderstring

Sort order.


paging.limitintegerminimum 0maximum 100format int32

Maximum number of items to return in the results.


paging.cursorstring

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.

Response Object
filesArray <FileDescriptor>maxItems 200

List of files in the Media Manager's trash bin.


nextCursorNextCursor

The next cursor if it exists.

List files in the Media Manager's trash bin

This example sorts by updatedDate in DESC order with a paging limit of 2.

Request
cURL
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>'
Response
JSON
{ "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 } }
Errors
400Invalid Argument

There are 2 errors with this status code:

See the entire list and learn more about Wix errors.

Did this help?

PATCH

Update File


Deprecated

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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/site-media/v1/files/update-file

Body Params
fileIdstringRequiredmaxLength 1000

ID of the file to update.

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).


displayNamestringmaxLength 200

File name that appears in the Media Manager.


parentFolderIdstringmaxLength 100

ID of the file's parent folder.
Default: media-root.


labelsArray <string>maxItems 500maxLength 200

Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by Google Vision API for images.

Response Object
fileFile

Information about the updated file.

Update a file
Request
cURL
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"] }'
Response
JSON
{ "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" } }
Did this help?

File Descriptor Deleted


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.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "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 } } }

FileDescriptorDeleted
JSON
{ "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 }
Did this help?

File Failed


Triggered when a file fails during essential post-upload processing.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor.


slugstring

Event name. Expected file_failed.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


actionEventActionEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "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 } } }

FileFailed
JSON
{ "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 }
Did this help?

File Ready


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.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor.


slugstring

Event name. Expected file_ready.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


actionEventActionEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "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 } } }

FileReady
JSON
{ "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 }
Did this help?

File Descriptor Updated


Triggered when a file is updated, including when a file is moved to a different folder.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Read Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.media.site_media.v1.file_descriptor.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "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 } } }

FileDescriptorUpdated
JSON
{ "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 }
Did this help?