> 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

# CreateGalleryItem

# Package: proGallery

# Namespace: ProGallery

# Method link: https://dev.wix.com/docs/api-reference/assets/pro-gallery/create-gallery-item.md

## Permission Scopes:
Manage Galleries: SCOPE.DC-PROGALLERY.MANAGE-GALLERIES

## Introduction

Creates a media item in a specified gallery.

> **Note:** When creating or updating image items in a pro gallery, the images must be uploaded or imported to the [Wix Media Manager](https://dev.wix.com/api/rest/media/media-manager) first, as the `imageInfo` parameter currently only supports the Wix Media URL.

---

## REST API

### Schema

```
 Method: createGalleryItem
 Description: Creates a media item in a specified gallery.  > **Note:** When creating or updating image items in a pro gallery, the images must be uploaded or imported to the [Wix Media Manager](https://dev.wix.com/api/rest/media/media-manager) first, as the `imageInfo` parameter currently only supports the Wix Media URL.
 URL: https://www.wixapis.com/progallery/v2/galleries/{galleryId}/items
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  item
 Method parameters: 
   param name: item | type: Item   | required: true 
    - ONE-OF: - required: true
     - name: image | type: Image | description: Details about the image.  
        - name: imageInfo | type: Image | description: Information about the Wix Media image.  
           - name: id | type: string | description: *Required.** WixMedia image GUID.  
           - name: height | type: integer | description: *Required.** Original image height.  
           - name: width | type: integer | description: *Required.** Original image width.  
           - name: altText | type: string | description: Image alt text.  
           - name: filename | type: string | description: Image filename.  
        - name: focalPoint | type: Point | description: Focal point of the image.  
           - name: x | type: number | description: X-coordinate of the focal point.  
           - name: y | type: number | description: Y-coordinate of the focal point.  
        - name: exif | type: object | description: Set of key-value pairs describing the media in [Exchangeable Image File format](https://en.wikipedia.org/wiki/Exif).  
        - name: quality | type: integer | description: Image compression level. <br />  Min: `30` <br /> Max: `100`  | validation: minimum 30, maximum 100, format int32
        - name: unsharpMasking | type: UnsharpMasking | description: [Unsharp masking](https://en.wikipedia.org/wiki/Unsharp_masking) values of the image.  
           - name: amount | type:  | description: Unsharp masking amount. Controls the sharpening strength. <br />  Min: `0` <br /> Max: `5`  | validation: minimum 0, maximum 5
           - name: radius | type:  | description: Unsharp masking radius in pixels. Controls the sharpening width.  
           - name: threshold | type:  | description: Unsharp masking threshold. Controls how different neighboring pixels must be for sharpening to apply. <br />  Min: `0` <br /> Max: `1`  | validation: minimum 0, maximum 1
     - name: video | type: Video | description: Details about the video.  
        - name: type | type: VideoType | description: Type of video.  
             - enum: UNDEFINED, WIX_MEDIA, YOUTUBE, VIMEO
        - name: videoInfo | type: VideoV2 | description: Information about the video.  
           - name: id | type: string | description: WixMedia GUID. Required when associating an existing Wix Media video.  
           - name: url | type: string | description: Video URL. Required when associating a video from an external source. Supported sources: YouTube, Vimeo.  
           - name: resolutions | type: array<VideoResolution> | description: Available resolutions for the video, starting with the optimal resolution.  | validation: maxItems 100
              - name: url | type: string | description: *Required.** Video URL.  
              - name: height | type: integer | description: *Required.** Video height.  
              - name: width | type: integer | description: *Required.** Video width.  
              - name: format | type: string | description: *Required.** Video format. For example, `mp4` or `hls`.  
              - name: quality | type: string | description: Video quality. For example, `480p` or `720p`.  
              - name: filename | type: string | description: Video filename.  
           - name: filename | type: string | description: Video filename.  
           - name: posters | type: array<Image> | description: Video posters.  
        - name: durationInMillis | type: integer | description: Manually defined video duration in milliseconds.  | validation: format int32
     - name: text | type: Text | description: Details about the text file.  
        - name: html | type: string | description: Text in HTML format.  
        - name: css | type: object | description: Set of key-value pairs describing the [CSS style](https://en.wikipedia.org/wiki/CSS) of the text.  __Note:__ The object structure is customizable. See the [List Gallery Items](https://dev.wix.com/api/rest/site-content/pro-gallery/list-gallery-items) code example for supported values.  
        - name: editorHtml | type: string | description: Reserved for internal use.  
        - name: editorFontId | type: string | description: Reserved for internal use.  
        - name: sortOrder | type: number | description: Index that determines which position a media item is displayed in the gallery. <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />  >**Note:** If you assign the same sort order index to more than one media item in a gallery, the function fails.  | validation: format double
        - name: title | type: string | description: Item title.  
        - name: description | type: string | description: Item description.  
        - name: link | type: Link | description: Link from the item. You can link to Wix sites or external URLs.  
           - name: text | type: string | description: Display text of the link.  
           - name: url | type: string | description: Target URL of the link.  
        - name: tags | type: Tags | description: Item tags.  
           - name: values | type: array<string> | description: List of tags assigned to the media item.  
 Return type: CreateGalleryItemResponse
  - name: item | type: Item | description: Created media item.  
     - ONE-OF: 
        - name: image | type: Image | description: Details about the image.  
           - name: imageInfo | type: Image | description: Information about the Wix Media image.  
              - name: id | type: string | description: *Required.** WixMedia image GUID.  
              - name: url | type: string | description: Image URL.  | read-only: true 
              - name: height | type: integer | description: *Required.** Original image height.  
              - name: width | type: integer | description: *Required.** Original image width.  
              - name: altText | type: string | description: Image alt text.  
              - name: filename | type: string | description: Image filename.  
           - name: focalPoint | type: Point | description: Focal point of the image.  
              - name: x | type: number | description: X-coordinate of the focal point.  
              - name: y | type: number | description: Y-coordinate of the focal point.  
           - name: exif | type: object | description: Set of key-value pairs describing the media in [Exchangeable Image File format](https://en.wikipedia.org/wiki/Exif).  
           - name: quality | type: integer | description: Image compression level. <br />  Min: `30` <br /> Max: `100`  | validation: minimum 30, maximum 100, format int32
           - name: unsharpMasking | type: UnsharpMasking | description: [Unsharp masking](https://en.wikipedia.org/wiki/Unsharp_masking) values of the image.  
              - name: amount | type:  | description: Unsharp masking amount. Controls the sharpening strength. <br />  Min: `0` <br /> Max: `5`  | validation: minimum 0, maximum 5
              - name: radius | type:  | description: Unsharp masking radius in pixels. Controls the sharpening width.  
              - name: threshold | type:  | description: Unsharp masking threshold. Controls how different neighboring pixels must be for sharpening to apply. <br />  Min: `0` <br /> Max: `1`  | validation: minimum 0, maximum 1
        - name: video | type: Video | description: Details about the video.  
           - name: type | type: VideoType | description: Type of video.  
                 - enum: UNDEFINED, WIX_MEDIA, YOUTUBE, VIMEO
           - name: videoInfo | type: VideoV2 | description: Information about the video.  
              - name: id | type: string | description: WixMedia GUID. Required when associating an existing Wix Media video.  
              - name: url | type: string | description: Video URL. Required when associating a video from an external source. Supported sources: YouTube, Vimeo.  
              - name: resolutions | type: array<VideoResolution> | description: Available resolutions for the video, starting with the optimal resolution.  | validation: maxItems 100
                 - name: url | type: string | description: *Required.** Video URL.  
                 - name: height | type: integer | description: *Required.** Video height.  
                 - name: width | type: integer | description: *Required.** Video width.  
                 - name: format | type: string | description: *Required.** Video format. For example, `mp4` or `hls`.  
                 - name: quality | type: string | description: Video quality. For example, `480p` or `720p`.  
                 - name: filename | type: string | description: Video filename.  
              - name: filename | type: string | description: Video filename.  
              - name: posters | type: array<Image> | description: Video posters.  
           - name: durationInMillis | type: integer | description: Manually defined video duration in milliseconds.  | validation: format int32
        - name: text | type: Text | description: Details about the text file.  
           - name: html | type: string | description: Text in HTML format.  
           - name: css | type: object | description: Set of key-value pairs describing the [CSS style](https://en.wikipedia.org/wiki/CSS) of the text.  __Note:__ The object structure is customizable. See the [List Gallery Items](https://dev.wix.com/api/rest/site-content/pro-gallery/list-gallery-items) code example for supported values.  
           - name: editorHtml | type: string | description: Reserved for internal use.  
           - name: editorFontId | type: string | description: Reserved for internal use.  
     - name: id | type: string | description: Item GUID.  | read-only: true | validation: format GUID
     - name: sortOrder | type: number | description: Index that determines which position a media item is displayed in the gallery. <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />  >**Note:** If you assign the same sort order index to more than one media item in a gallery, the function fails.  | validation: format double
     - name: title | type: string | description: Item title.  
     - name: description | type: string | description: Item description.  
     - name: link | type: Link | description: Link from the item. You can link to Wix sites or external URLs.  
        - name: text | type: string | description: Display text of the link.  
        - name: url | type: string | description: Target URL of the link.  
     - name: type | type: Type | description: Type of item.  | read-only: true 
         - enum: UNDEFINED, IMAGE, VIDEO, TEXT
     - name: createdDate | type: string | description: Date and time the item was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the item was last updated.  | read-only: true | validation: format date-time
     - name: tags | type: Tags | description: Item tags.  
        - name: values | type: array<string> | description: List of tags assigned to the media item.  


```

### Examples

### Create a gallery item
```curl
curl -X POST \
'https://www.wixapis.com/progallery/v2/galleries/e481d9b4-14b9-4a98-ae52-67f4170e3a63/items' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
  "item": {
    "id": "a045b201-ee7d-447c-b0c3-746cba83253c",
    "sortOrder": 1644317968.985,
    "title": "Some Title",
    "description": "Some Description",
    "type": "IMAGE",
    "image": {
      "type": "WIX_MEDIA",
      "imageInfo": {
        "id": "11062b_12703ed9a6574547bcaed22b1ce44eef~mv2.jpeg",
        "url": "https://static.wixstatic.com/media/11062b_12703ed9a6574547bcaed22b1ce44eef~mv2.jpeg",
        "height": 4298,
        "width": 6446
      },
      "focalPoint": {
        "x": 0.5,
        "y": 0.5
      }
    }
  }
}'
```

---