> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Package: mediaManager

# Namespace: files

# Webhook link: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/file-descriptor-file-ready.md

# Webhook Permissions Scopes IDs:
Read Media Manager: SCOPE.DC-MEDIA.READ-MEDIAMANAGER

## Introduction

Triggered when a file finishes processing successfully. Learn more about [knowing when a file is ready](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/importing-files.md#knowing-when-a-file-is-ready).

---

## REST API

### Schema

```
Webhook: File Descriptor File Ready
Description: Triggered when a file finishes processing successfully. Learn more about [knowing when a file is ready](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/importing-files.md#knowing-when-a-file-is-ready).
Event body:
 - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events.
 - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event.
 - name: slug | type: string | description: Event name.
 - name: entityId | type: string | description: ID of the entity associated with the event.
 - name: eventTime | type: string (date-time) | description: Event timestamp.
 - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR.
 - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
 - name: actionEvent | type: object | description: Custom action event details.
    - name: body | type: FileReady | description: The event body.
        - name: file | type: FileDescriptor | description: File entity that is ready with full information.
           - 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: Unknown media type.
               -     IMAGE: Image file, such as JPEG or PNG.
               -     VIDEO: Video file.
               -     AUDIO: Audio file.
               -     DOCUMENT: Document file, such as PDF.
               -     VECTOR: Vector image file, such as SVG.
               -     ARCHIVE: Archive file, such as ZIP.
               -     MODEL3D: 3D model file.
               -     OTHER: Any other file type.
           - name: media | type: FileMedia | description: Media-type-specific metadata, such as an image's dimensions or a video's available resolutions. The relevant property is populated according to the file's `mediaType`.
              - 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<Color> | description: Color palette of the image.
                    - name: faces | type: array<FaceRecognition> | 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<VideoResolution> | 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<Audio> | description: Audio formats available for this file.
                       - name: id | type: string | description: WixMedia GUID.
                       - name: url | type: string | description: Audio URL.
                       - name: filename | type: string | description: Audio filename.
                    - name: bitrate | type: integer | description: Audio bitrate.
                    - name: format | type: string | description: Audio format.
                    - name: duration | type: integer | description: Audio duration in seconds.
                    - name: sizeInBytes | type: string | description: Audio size in bytes.
                 - name: document | type: Document | description: Information about the document.
                    - name: id | type: string | description: WixMedia GUID.
                    - name: url | type: string | description: Document URL.
                    - name: filename | type: string | description: Document filename.
                 - name: vector | type: ImageMedia | description: Information about the vector.
                 - name: archive | type: Archive | description: Information about the archive.
                    - name: id | type: string | description: WixMedia GUID.
                    - name: url | type: string | description: Archive URL.
                    - name: urlExpirationDate | type: string | description: Archive URL expiration date (when relevant).
                    - name: sizeInBytes | type: string | description: Archive size in bytes.
                    - name: filename | type: string | description: Archive filename.
                 - name: model3d | type: Model3D | description: Information about the 3D Model.
                    - name: id | type: string | description: WixMedia 3D GUID.
                    - name: url | type: string | description: 3D URL.
                    - name: thumbnail | type: Image | description: 3D thumbnail Image
                    - name: altText | type: string | description: 3D alt text.
                    - name: urlExpirationDate | type: string | description: 3D URL expiration date (when relevant).
                    - name: filename | type: string | description: 3D filename.
                    - name: sizeInBytes | type: string | description: 3D size in bytes.
           - name: operationStatus | type: OperationStatus | description: Status of the file that was uploaded.
               - enum:
               -     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.
           - name: sourceUrl | type: string | description: URL where the file was uploaded from.
           - name: thumbnailUrl | type: string | description: URL of the file's thumbnail.
           - name: labels | type: array<string> | 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: createdDate | type: string | description: Date and time the file was created.
           - name: updatedDate | type: string | description: Date and time the file was updated.
           - name: siteId | type: string | description: The Wix site GUID where the media file is stored.
           - name: state | type: State | description: State of the file.
               - enum:
               -     OK: File is ready for consumption
               -     DELETED: Deleted file
        - name: externalInfo | type: ExternalInfo | description: External information specified in the file import or upload.
           - name: origin | type: string | description: Identifier of the app or service that initiated the upload or import, for example your app's GUID. Returned in the resulting File Ready and File Failed events, and can be used to filter events by their origin.
           - name: externalIds | type: array<string> | description: IDs from your own system, for example the GUIDs of the entities the file belongs to. Returned in the resulting File Ready and File Failed events, and can be used to correlate an event with the call that triggered it.
        - name: triggeredByUndelete | type: boolean | description: Whether the event was triggered by restoring a file from the Media Manager's trash bin.  Default: `false`

```

### Examples


```curl
{
  "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
}
```

---

## JavaScript SDK

### Schema

```
Webhook: onFileDescriptorFileReady
Description: Triggered when a file finishes processing successfully. Learn more about [knowing when a file is ready](https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/importing-files.md#knowing-when-a-file-is-ready).
Payload: FileDescriptorFileReadyEnvelope
  - name: data | type: FileReady | description: none
     - name: file | type: FileDescriptor | description: File entity that is ready with full information.
        - 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: Unknown media type.
             -     IMAGE: Image file, such as JPEG or PNG.
             -     VIDEO: Video file.
             -     AUDIO: Audio file.
             -     DOCUMENT: Document file, such as PDF.
             -     VECTOR: Vector image file, such as SVG.
             -     ARCHIVE: Archive file, such as ZIP.
             -     MODEL3D: 3D model file.
             -     OTHER: Any other file type.
        - name: media | type: FileMedia | description: Media-type-specific metadata, such as an image's dimensions or a video's available resolutions. The relevant property is populated according to the file's `mediaType`.
           - ONE-OF:
              - name: image | type: ImageMedia | description: Information about the image.
                 - name: image | type: string | description: Image data.
                 - 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<Color> | description: Color palette of the image.
                 - name: faces | type: array<FaceRecognition> | 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: string | 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: string | description: Information about the video.
              - name: audio | type: AudioV2 | description: Information about the audio.
                 - name: _id | type: string | description: WixMedia GUID.
                 - name: assets | type: array<string> | description: Audio formats available for this file.
                 - name: bitrate | type: integer | description: Audio bitrate.
                 - name: format | type: string | description: Audio format.
                 - name: duration | type: integer | description: Audio duration in seconds.
                 - name: sizeInBytes | type: string | description: Audio size in bytes.
              - name: document | type: string | description: Information about the document.
              - name: vector | type: ImageMedia | description: Information about the vector.
              - name: archive | type: Archive | description: Information about the archive.
                 - name: _id | type: string | description: WixMedia GUID.
                 - name: url | type: string | description: Archive URL.
                 - name: urlExpirationDate | type: Date | description: Archive URL expiration date (when relevant).
                 - name: sizeInBytes | type: string | description: Archive size in bytes.
                 - name: filename | type: string | description: Archive filename.
              - name: model3d | type: Model3D | description: Information about the 3D Model.
                 - name: _id | type: string | description: WixMedia 3D GUID.
                 - name: url | type: string | description: 3D URL.
                 - name: thumbnail | type: string | description: 3D thumbnail Image
                 - name: altText | type: string | description: 3D alt text.
                 - name: urlExpirationDate | type: Date | description: 3D URL expiration date (when relevant).
                 - name: filename | type: string | description: 3D filename.
                 - name: sizeInBytes | type: string | description: 3D size in bytes.
        - name: operationStatus | type: OperationStatus | description: Status of the file that was uploaded.
             - enum:
             -     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.
        - name: sourceUrl | type: string | description: URL where the file was uploaded from.
        - name: thumbnailUrl | type: string | description: URL of the file's thumbnail.
        - name: labels | type: array<string> | 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: _createdDate | type: Date | description: Date and time the file was created.
        - name: _updatedDate | type: Date | description: Date and time the file was updated.
        - name: siteId | type: string | description: The Wix site GUID where the media file is stored.
        - name: state | type: State | description: State of the file.
             - enum:
             -     OK: File is ready for consumption
             -     DELETED: Deleted file
     - name: externalInfo | type: ExternalInfo | description: External information specified in the file import or upload.
        - name: origin | type: string | description: Identifier of the app or service that initiated the upload or import, for example your app's GUID. Returned in the resulting File Ready and File Failed events, and can be used to filter events by their origin.
        - name: externalIds | type: array<string> | description: IDs from your own system, for example the GUIDs of the entities the file belongs to. Returned in the resulting File Ready and File Failed events, and can be used to correlate an event with the call that triggered it.
     - name: triggeredByUndelete | type: boolean | description: Whether the event was triggered by restoring a file from the Media Manager's trash bin.  Default: `false`
  - name: metadata | type: EventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them.
     - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     - name: entityId | type: string | description: GUID of the entity associated with the event.
     - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
     - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
     - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.

```

### Examples


```javascript
import { files } from '@wix/media';

files.onFileDescriptorFileReady((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { files } from '@wix/media';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      files,
    },
});

wixClient.files.onFileDescriptorFileReady((event) => {
    // handle your event here
});
```

---