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 Events
Access Verticals by Automations
Set Up Automations
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.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?