> 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

# BulkUpdateProjectItems

# Package: portfolio

# Namespace: ProjectItemsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/portfolio/project-items/bulk-update-project-items.md

## Permission Scopes:
Manage Portfolio: SCOPE.PORTFOLIO.MANAGE-PORTFOLIO

## Introduction

Updates multiple project items.

To update a single project item, call Update Project Item.

---

## REST API

### Schema

```
 Method: bulkUpdateProjectItems
 Description: Updates multiple project items.  To update a single project item, call Update Project Item.
 URL: https://www.wixapis.com/portfolio/project-items/api/v1/bulk/portfolio/items/update
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  items.item, items.item.id
 Method parameters: 
   param name: items | type: array<items> | description: Project items to update.  | validation: maxItems 100
              - name: item | type: Item | description: Item to be updated. | required: true 
                 - ONE-OF: 
                    - name: image | type: Image | description: Information about the Wix Media image.  
                       - name: imageInfo | type: Image | description: Information about the Wix Media image.  
                          - name: id | type: string | description: WixMedia image GUID. Required.  | validation: maxLength 512
                          - name: height | type: integer | description: Original image height. Required.  
                          - name: width | type: integer | description: Original image width. Required.  
                          - name: altText | type: string | description: Image alt text.  | validation: maxLength 5000
                          - name: filename | type: string | description: Image filename.  | validation: maxLength 512
                       - 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: altText | type: string | description: Alt text of the image, for screen readers and SEO. On read, the same value as `image_info.alt_text`. On write, both fields set the same stored value; when the update mask names this field, it wins. Use this field from the SDK, where `image_info` is a `wix:image` string that cannot carry alt text.  | validation: maxLength 5000
                    - name: video | type: Video | description: Information about the Wix Media video.  
                       - name: videoInfo | type: VideoV2 | description: Information about the Wix Media video.  
                          - name: id | type: string | description: WixMedia GUID. Required.  | validation: maxLength 512
                          - name: url | type: string | description: Video URL.  | validation: maxLength 8000
                          - name: resolutions | type: array<VideoResolution> | description: Available resolutions for the video, starting with the optimal resolution.  | validation: maxItems 100
                             - name: url | type: string | description: Video URL.  Required.  | validation: maxLength 8000
                             - name: height | type: integer | description: Video height. Required.  
                             - name: width | type: integer | description: Video width.  Required.  
                             - name: format | type: string | description: Video format for example, mp4, hls.  Required.  | validation: maxLength 50
                             - name: quality | type: string | description: Video quality for example 480p, 720p.  | validation: maxLength 50
                             - name: filename | type: string | description: Video filename.  | validation: maxLength 512
                          - name: filename | type: string | description: Video filename.  | validation: maxLength 512
                          - name: posters | type: array<Image> | description: Video posters.  | validation: maxItems 100
                       - name: durationInMillis | type: integer | description: Manually defined Video duration in milliseconds.  | validation: format int32
                 - name: projectId | type: string | description: Project GUID.  | validation: format GUID
                 - name: id | type: string | description: Project item GUID. | required: true | read-only: true | validation: format GUID
                 - name: sortOrder | type: number | description: Index that determines which position a project is displayed in the project.  <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />  | validation: format double
                 - name: title | type: string | description: Project item title.  
                 - name: description | type: string | description: Project item description.  
                 - name: link | type: Link | description: Project item link.  
                    - name: text | type: string | description: Display text of the link.  
                    - name: url | type: string | description: Target URL of the link.  | validation: format WEB_URL
                    - name: target | type: string | description: Whether the link opens in a new tab or window. One of: * `'_blank'`: The link opens in a new tab or window. * `'_self'`: The link opens in the same tab or window.  | validation: maxLength 50
   param name: returnFullEntity | type: returnFullEntity | description: Whether to return the updated project items.  Set to `true` to return the project items in the response.  Default: `false`  
 Return type: BulkUpdateProjectItemsResponse
  - name: results | type: array<BulkUpdateProjectItemResult> | description: List of individual Bulk Update Project Items results.  
     - name: itemMetadata | type: ItemMetadata | description: Information about the updated project item. Including its GUID, index in the bulk request and whether it was successfully updated.  
        - 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: Item | description: Updated project item. Only returned if `returnEntity` is set to `true` in the request.  
        - ONE-OF: 
           - name: image | type: Image | description: Information about the Wix Media image.  
              - name: imageInfo | type: Image | description: Information about the Wix Media image.  
                 - name: id | type: string | description: WixMedia image GUID. Required.  | validation: maxLength 512
                 - name: url | type: string | description: Image URL.  | read-only: true | validation: maxLength 8000
                 - name: height | type: integer | description: Original image height. Required.  
                 - name: width | type: integer | description: Original image width. Required.  
                 - name: altText | type: string | description: Image alt text.  | validation: maxLength 5000
                 - name: filename | type: string | description: Image filename.  | validation: maxLength 512
              - 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: altText | type: string | description: Alt text of the image, for screen readers and SEO. On read, the same value as `image_info.alt_text`. On write, both fields set the same stored value; when the update mask names this field, it wins. Use this field from the SDK, where `image_info` is a `wix:image` string that cannot carry alt text.  | validation: maxLength 5000
           - name: video | type: Video | description: Information about the Wix Media video.  
              - name: videoInfo | type: VideoV2 | description: Information about the Wix Media video.  
                 - name: id | type: string | description: WixMedia GUID. Required.  | validation: maxLength 512
                 - name: url | type: string | description: Video URL.  | validation: maxLength 8000
                 - name: resolutions | type: array<VideoResolution> | description: Available resolutions for the video, starting with the optimal resolution.  | validation: maxItems 100
                    - name: url | type: string | description: Video URL.  Required.  | validation: maxLength 8000
                    - name: height | type: integer | description: Video height. Required.  
                    - name: width | type: integer | description: Video width.  Required.  
                    - name: format | type: string | description: Video format for example, mp4, hls.  Required.  | validation: maxLength 50
                    - name: quality | type: string | description: Video quality for example 480p, 720p.  | validation: maxLength 50
                    - name: filename | type: string | description: Video filename.  | validation: maxLength 512
                 - name: filename | type: string | description: Video filename.  | validation: maxLength 512
                 - name: posters | type: array<Image> | description: Video posters.  | validation: maxItems 100
              - name: durationInMillis | type: integer | description: Manually defined Video duration in milliseconds.  | validation: format int32
        - name: projectId | type: string | description: Project GUID.  | validation: format GUID
        - name: id | type: string | description: Project item GUID.  | read-only: true | validation: format GUID
        - name: sortOrder | type: number | description: Index that determines which position a project is displayed in the project.  <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />  | validation: format double
        - name: title | type: string | description: Project item title.  
        - name: description | type: string | description: Project item description.  
        - name: type | type: Type | description: Project item data type.  | read-only: true 
             - enum:
             -     UNDEFINED: Undefined item type.
             -     IMAGE: Image item type.
             -     VIDEO: Video item type.
        - name: createdDate | type: string | description: Date and time the project item was created.  | read-only: true | validation: format date-time
        - name: updatedDate | type: string | description: Date and time the project item was last updated.  | read-only: true | validation: format date-time
        - name: link | type: Link | description: Project item link.  
           - name: text | type: string | description: Display text of the link.  
           - name: url | type: string | description: Target URL of the link.  | validation: format WEB_URL
           - name: target | type: string | description: Whether the link opens in a new tab or window. One of: * `'_blank'`: The link opens in a new tab or window. * `'_self'`: The link opens in the same tab or window.  | validation: maxLength 50
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Total number of successes and failures for Bulk Update Project Items.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### Bulk Update Project Items
```curl
curl -X PATCH \
'https://www.wixapis.com/api/v1/bulk/portfolio/items/update' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "items": [
    {
      "id": "456e7890-e89b-12d3-a456-426614174001",
      "title": "Updated Item Title 1",
      "description": "This is an updated item description 1.",
      "sortOrder": 1.0,
      "image": {
        "imageInfo": {
          "url": "https://example.com/new-image1.jpg",
          "id": "9a7eef_afc3d989928f45198a16175e3c7aba3d"
      },
      "link": {
        "text": "Visit Updated Site 1",
        "url": "https://example-update.com",
        "target": "_blank"
      }
    },
      "id": "456e7890-e89b-12d3-a456-426614174002",
      "title": "Updated Item Title 2",
      "description": "This is an updated item description 2.",
      "sortOrder": 2.0,
      "video": {
        "videoInfo": {
          "id": "4889bbcc7fb-66b77-888aaf-3c45227f",
          "url": "https://example.com/updated_video2.mp4"
        }
      },
      "link": {
        "text": "Visit Updated Site 2",
        "url": "https://example2-update.com",
        "target": "_self"
      }
    }
  ],
  "returnFullEntity": true
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.portfolio.projectItems.bulkUpdateProjectItems(options)
 Description: Updates multiple project items.  To update a single project item, call Update Project Item.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.items.item, options.items.item._id
 Method parameters: 
   param name: options | type: BulkUpdateProjectItemsOptions  none  
        - name: items | type: array<MaskedItem> | description: Project items to update.  | validation: maxItems 100
           - name: item | type: Item | description: Item to be updated.  
              - ONE-OF: 
                 - name: image | type: Image | description: Information about the Wix Media image.  
                    - name: imageInfo | type: string | description: Information about the Wix Media image.  
                    - 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: altText | type: string | description: Alt text of the image, for screen readers and SEO. On read, the same value as `image_info.alt_text`. On write, both fields set the same stored value; when the update mask names this field, it wins. Use this field from the SDK, where `image_info` is a `wix:image` string that cannot carry alt text.  | validation: maxLength 5000
                 - name: video | type: Video | description: Information about the Wix Media video.  
                    - name: videoInfo | type: string | description: Information about the Wix Media video.  
                    - name: durationInMillis | type: integer | description: Manually defined Video duration in milliseconds.  | validation: format int32
              - name: projectId | type: string | description: Project GUID.  | validation: format GUID
              - name: sortOrder | type: number | description: Index that determines which position a project is displayed in the project.  <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />  
              - name: title | type: string | description: Project item title.  
              - name: description | type: string | description: Project item description.  
              - name: link | type: Link | description: Project item link.  
                 - name: text | type: string | description: Display text of the link.  
                 - name: url | type: string | description: Target URL of the link.  | validation: format WEB_URL
                 - name: target | type: string | description: Whether the link opens in a new tab or window. One of: * `'_blank'`: The link opens in a new tab or window. * `'_self'`: The link opens in the same tab or window.  | validation: maxLength 50
        - name: returnFullEntity | type: boolean | description: Whether to return the updated project items.  Set to `true` to return the project items in the response.  Default: `false`  
 Return type: PROMISE<BulkUpdateProjectItemsResponse>
  - name: results | type: array<BulkUpdateProjectItemResult> | description: List of individual Bulk Update Project Items results.  
     - name: itemMetadata | type: ItemMetadata | description: Information about the updated project item. Including its GUID, index in the bulk request and whether it was successfully updated.  
        - 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: Item | description: Updated project item. Only returned if `returnEntity` is set to `true` in the request.  
        - ONE-OF: 
           - name: image | type: Image | description: Information about the Wix Media image.  
              - name: imageInfo | type: string | description: Information about the Wix Media image.  
              - 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: altText | type: string | description: Alt text of the image, for screen readers and SEO. On read, the same value as `image_info.alt_text`. On write, both fields set the same stored value; when the update mask names this field, it wins. Use this field from the SDK, where `image_info` is a `wix:image` string that cannot carry alt text.  | validation: maxLength 5000
           - name: video | type: Video | description: Information about the Wix Media video.  
              - name: videoInfo | type: string | description: Information about the Wix Media video.  
              - name: durationInMillis | type: integer | description: Manually defined Video duration in milliseconds.  | validation: format int32
        - name: projectId | type: string | description: Project GUID.  | validation: format GUID
        - name: _id | type: string | description: Project item GUID.  | read-only: true | validation: format GUID
        - name: sortOrder | type: number | description: Index that determines which position a project is displayed in the project.  <br />  Default: [Epoch](https://www.epoch101.com/) timestamp. <br />  
        - name: title | type: string | description: Project item title.  
        - name: description | type: string | description: Project item description.  
        - name: type | type: Type | description: Project item data type.  | read-only: true 
             - enum:
             -     UNDEFINED: Undefined item type.
             -     IMAGE: Image item type.
             -     VIDEO: Video item type.
        - name: _createdDate | type: Date | description: Date and time the project item was created.  | read-only: true 
        - name: _updatedDate | type: Date | description: Date and time the project item was last updated.  | read-only: true 
        - name: link | type: Link | description: Project item link.  
           - name: text | type: string | description: Display text of the link.  
           - name: url | type: string | description: Target URL of the link.  | validation: format WEB_URL
           - name: target | type: string | description: Whether the link opens in a new tab or window. One of: * `'_blank'`: The link opens in a new tab or window. * `'_self'`: The link opens in the same tab or window.  | validation: maxLength 50
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Total number of successes and failures for Bulk Update Project Items.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### bulkUpdateProjectItems
```javascript
import { projectItems } from '@wix/portfolio';

async function bulkUpdateProjectItems(options) {
  const response = await projectItems.bulkUpdateProjectItems(options);
};
```

### bulkUpdateProjectItems (with elevated permissions)
```javascript
import { projectItems } from '@wix/portfolio';
import { auth } from '@wix/essentials';

async function myBulkUpdateProjectItemsMethod(options) {
  const elevatedBulkUpdateProjectItems = auth.elevate(projectItems.bulkUpdateProjectItems);
  const response = await elevatedBulkUpdateProjectItems(options);
}
```

### bulkUpdateProjectItems (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { projectItems } from '@wix/portfolio';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { projectItems },
  // Include the auth strategy and host as relevant
});


async function bulkUpdateProjectItems(options) {
  const response = await myWixClient.projectItems.bulkUpdateProjectItems(options);
};
```

---