> Portal Navigation:
>
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt
# BulkImportFile
# Package: mediaManager
# Namespace: FilesService
# Method link: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/bulk-import-file.md
## Permission Scopes:
Manage Media Manager: SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
## Introduction
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](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/importing-files.md).
To import files, you need to do one of the following for each file:
- Specify its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) 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'`.
---
## REST API
### Schema
```
Method: bulkImportFile
Description: 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](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/importing-files.md). To import files, you need to do one of the following for each file: - Specify its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) 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'`.
URL: https://www.wixapis.com/site-media/v1/bulk/files/import-v2
Method: POST
# Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
Required parameters: importFileRequests, importFileRequests.url
Method parameters:
param name: importFileRequests | type: array | description: Information about the files to import. | required: true
- name: url | type: string | description: Publicly accessible external file URL. | required: true
- name: mediaType | type: MediaType | description: Media type of the file to import. excluding: OTHER media type
- enum: UNKNOWN, IMAGE, VIDEO, AUDIO, DOCUMENT, VECTOR, ARCHIVE, MODEL3D, OTHER
- name: displayName | type: string | description: File name that appears in the Media Manager.
- name: parentFolderId | type: string | description: GUID of the file's parent folder. This folder is the path root for the `filePath`. Default: `media-root`.
- name: private | type: boolean | description: Whether the file will be public or private. Learn more [about private files](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/private-files.md).
- name: labels | type: array | description: Labels assigned to media files that describe and categorize them. Provided by the Wix user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images.
- name: mimeType | type: string | description: File mime type.
- name: externalInfo | type: ExternalInfo | description: Information sent to the File Ready and File Failed events. See [Importing Files](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/importing-files.md) to learn more.
- name: origin | type: string | description: External information to specify in the File Ready or File Failed events.
- name: externalIds | type: array | description: External GUIDs to specify in the File Ready or File Failed events.
- name: urlParams | type: object | description: Optional parameters that should be sent with the external URL.
- name: urlHeaders | type: object | description: Optional headers that should be sent with the external URL.
- name: filePath | type: string | description: 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.
param name: returnEntity | type: returnEntity | description: Default: `true`
Return type: BulkImportFileResponse
- name: results | type: array | description: Items created by bulk action.
- name: itemMetadata | type: ItemMetadata | description: Item metadata.
- name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).
- name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.
- name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.
- name: error | type: ApplicationError | description: Details about the error in case of failure.
- name: code | type: string | description: Error code.
- name: description | type: string | description: Description of the error.
- name: data | type: object | description: Data related to the error.
- name: item | type: FileDescriptor | description: Imported file. This field is included in the response if the operation was successful and `returnEntity` is not set to `false`.
- name: id | type: string | description: File GUID. Generated when a file is uploaded to the Media Manager.
- name: displayName | type: string | description: File name as it appears in the Media Manager.
- name: url | type: string | description: Static URL of the file.
- name: parentFolderId | type: string | description: GUID of the file's parent folder.
- name: hash | type: string | description: File hash.
- name: sizeInBytes | type: string | description: Size of the uploaded file in bytes.
- name: private | type: boolean | description: Whether the file is public or private. Learn more about [private files](https://dev.wix.com/docs/rest/assets/media/media-manager/files/private-files.md).
- name: mediaType | type: MediaType | description: Media file type.
- enum: UNKNOWN, IMAGE, VIDEO, AUDIO, DOCUMENT, VECTOR, ARCHIVE, MODEL3D, OTHER
- name: media | type: FileMedia | description: Media file content.
- ONE-OF:
- name: image | type: ImageMedia | description: Information about the image.
- name: image | type: Image | description: Image data.
- name: id | type: string | description: WixMedia image GUID.
- name: url | type: string | description: Image URL.
- name: height | type: integer | description: Original image height.
- name: width | type: integer | description: Original image width.
- name: altText | type: string | description: Image alt text.
- name: filename | type: string | description: Image filename.
- name: colors | type: Colors | description: Image colors.
- name: prominent | type: Color | description: Main color of the image.
- name: hex | type: string | description: HEX color.
- name: rgb | type: ColorRGB | description: RGB color.
- name: r | type: integer | description: Red channel.
- name: g | type: integer | description: Green channel.
- name: b | type: integer | description: Blue channel.
- name: palette | type: array | description: Color palette of the image.
- name: faces | type: array | description: Information about faces in the image. Use to crop images without cutting out faces.
- name: confidence | type: number | description: The accuracy percentage of the face recognition. The likelihood that a face is detected.
- name: x | type: integer | description: Top left x pixel coordinate of the face.
- name: y | type: integer | description: Top left y pixel coordinate of the face.
- name: height | type: integer | description: Face pixel height.
- name: width | type: integer | description: Face pixel width.
- name: previewImage | type: Image | description: Information about the image preview. You can use this to display a preview for private images.
- name: caption | type: string | description: Optional, An AI generated description of the image
- name: video | type: VideoV2 | description: Information about the video.
- name: id | type: string | description: WixMedia GUID.
- name: resolutions | type: array | description: Available resolutions for the video, starting with the optimal resolution.
- name: url | type: string | description: Video URL.
- name: height | type: integer | description: Video height.
- name: width | type: integer | description: Video width.
- name: format | type: string | description: Video format Possible values: ['144p.mp4' '144p.webm' '240p.mp4' '240p.webm' '360p.mp4' '360p.webm' '480p.mp4' '480p.webm' '720p.mp4' '720p.webm' '1080p.mp4' '1080p.webm', 'hls' ]
- name: filename | type: string | description: Video filename.
- name: audio | type: AudioV2 | description: Information about the audio.
- name: id | type: string | description: WixMedia GUID.
- name: assets | type: array