> 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

# BulkUpdateSteps

# Package: onlinePrograms

# Namespace: StepsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-update-steps.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Updates up to 100 steps in a single API call.

Each time a step is updated, `revision` increments by 1. The current `revision` must be passed when updating the step. This ensures you're working with the latest step and prevents unintended overwrites.

Use this method for content updates across multiple steps.
To move a step within a section or to another section, call [MoveStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/move-step.md).

To update a single step, call [UpdateStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/update-step.md).

---

## REST API

### Schema

```
 Method: bulkUpdateSteps
 Description: Updates up to 100 steps in a single API call.  Each time a step is updated, `revision` increments by 1. The current `revision` must be passed when updating the step. This ensures you're working with the latest step and prevents unintended overwrites.  Use this method for content updates across multiple steps. To move a step within a section or to another section, call [MoveStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/move-step.md).  To update a single step, call [UpdateStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/update-step.md).
 URL: https://www.wixapis.com/online-programs/v3/bulk/steps/update
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  steps, steps.step.id, steps.step.revision
 Method parameters: 
   param name: returnEntity | type: returnEntity | description: Whether to return updated steps in the response.  
   param name: steps | type: array<steps> | description: Steps to update. | required: true | validation: minItems 1, maxItems 100
              - name: step | type: Step | description: Step to update. May be partial.  
                 - ONE-OF: 
                    - name: videoOptions | type: VideoOptions | description: Video-specific settings.  
                       - ONE-OF: 
                          - name: wixVideo | type: WixVideo | description: Video from Wix Video.  
                             - name: id | type: string | description: Wix Video GUID.  | validation: format GUID
                             - name: paid | type: boolean | description: Whether the Wix Video is paid content.  
                          - name: video | type: VideoV2 | description: Video uploaded with Media Manager.  
                             - name: id | type: string | description: WixMedia GUID.  
                       - name: requiredCompletionPercentage | type: number | description: Percentage of the video that must be watched to complete the step.  
                       - name: coverImage | type: Image | description: Cover image for the video.  
                          - name: id | type: string | description: WixMedia image GUID.  
                          - name: url | type: string | description: Image URL.  
                          - name: altText | type: string | description: Image alt text.  
                       - name: durationInMilliseconds | type: integer | description: Video duration in milliseconds.  | validation: format int32
                       - name: deleted | type: boolean | description: Whether the uploaded video was deleted from Media Manager.  
                    - name: quizOptions | type: QuizOptions | description: Quiz-specific settings.  
                       - name: passingGrade | type: number | description: Minimum percentage required to pass the quiz.  | validation: format double
                 - name: id | type: string | description: Step GUID. | required: true | read-only: true | validation: format GUID
                 - name: revision | type: string | description: Revision number, which increments by 1 each time the step is updated. To prevent conflicting changes, the current `revision` must be passed when updating the step. | required: true | read-only: true | validation: format int64
                 - name: description | type: Description | description: Step title, rich text content, and optional media.  
                    - ONE-OF: 
                       - name: image | type: Image | description: Image displayed with the step content.  
                       - name: video | type: VideoV2 | description: Video displayed with the step content.  
                    - name: title | type: string | description:   | validation: maxLength 250
                    - name: details | type: string | description:   | validation: maxLength 1000000
                 - name: ordering | type: number | description: Step position within the section.  
                 - name: stepType | type: StepType | description: Type of content in the step.  
                         - enum:
                         -     ARTICLE: Text-based step.
                         -     VIDEO: Step with video content.
                         -     QUIZ: Step linked to a quiz.
                 - name: extendedFields | type: ExtendedFields | description: Custom field data for the step object.  
                    - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
              - name: fieldMask | type:  | description: Explicit list of fields to update.  
 Return type: BulkUpdateStepsResponse
  - name: results | type: array<BulkUpdateStepResult> | description:   | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the processed step.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  | validation: format GUID
        - 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: Step | description: Updated step. Returned only when `returnEntity` is `true`.  
        - ONE-OF: 
           - name: videoOptions | type: VideoOptions | description: Video-specific settings.  
              - ONE-OF: 
                 - name: wixVideo | type: WixVideo | description: Video from Wix Video.  
                    - name: id | type: string | description: Wix Video GUID.  | validation: format GUID
                    - name: paid | type: boolean | description: Whether the Wix Video is paid content.  
                 - name: video | type: VideoV2 | description: Video uploaded with Media Manager.  
                    - name: id | type: string | description: WixMedia GUID.  
                    - name: resolutions | type: array<VideoResolution> | description: Available resolutions for the video, starting with the optimal resolution.  | read-only: true | validation: maxItems 100
                       - 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 for example, mp4, hls.  
                    - name: filename | type: string | description: Video filename.  | read-only: true 
              - name: requiredCompletionPercentage | type: number | description: Percentage of the video that must be watched to complete the step.  
              - name: coverImage | type: Image | description: Cover image for the video.  
                 - name: id | type: string | description: WixMedia image GUID.  
                 - name: url | type: string | description: Image URL.  
                 - name: height | type: integer | description: Original image height.  | read-only: true 
                 - name: width | type: integer | description: Original image width.  | read-only: true 
                 - name: altText | type: string | description: Image alt text.  
                 - name: filename | type: string | description: Image filename.  | read-only: true 
              - name: durationInMilliseconds | type: integer | description: Video duration in milliseconds.  | validation: format int32
              - name: deleted | type: boolean | description: Whether the uploaded video was deleted from Media Manager.  
           - name: quizOptions | type: QuizOptions | description: Quiz-specific settings.  
              - name: id | type: string | description: Quiz GUID. Provide it when creating a quiz step. After creation, the quiz reference can't be changed.  | read-only: true | validation: format GUID, immutable
              - name: totalQuestions | type: integer | description: Total number of questions in the quiz.  | read-only: true 
              - name: passingGrade | type: number | description: Minimum percentage required to pass the quiz.  | validation: format double
        - name: id | type: string | description: Step GUID.  | read-only: true | validation: format GUID
        - name: revision | type: string | description: Revision number, which increments by 1 each time the step is updated. To prevent conflicting changes, the current `revision` must be passed when updating the step.  | read-only: true | validation: format int64
        - name: createdDate | type: string | description: Date and time the step was created.  | read-only: true | validation: format date-time
        - name: updatedDate | type: string | description: Date and time the step was updated.  | read-only: true | validation: format date-time
        - name: sectionId | type: string | description: Parent section GUID. To move a step within a section or to another section, call `MoveStep`.  | read-only: true | validation: format GUID
        - name: description | type: Description | description: Step title, rich text content, and optional media.  
           - ONE-OF: 
              - name: image | type: Image | description: Image displayed with the step content.  
              - name: video | type: VideoV2 | description: Video displayed with the step content.  
           - name: title | type: string | description:   | validation: maxLength 250
           - name: details | type: string | description:   | validation: maxLength 1000000
        - name: ordering | type: number | description: Step position within the section.  
        - name: stepType | type: StepType | description: Type of content in the step.  
             - enum:
             -     ARTICLE: Text-based step.
             -     VIDEO: Step with video content.
             -     QUIZ: Step linked to a quiz.
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the step object.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
        - name: programId | type: string | description: Program GUID.  | read-only: true | validation: format GUID
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk action.  
     - 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

### Update multiple steps
Updates multiple step titles in a single request.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/v3/bulk/steps/update' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "steps": [
    {
      "step": {
        "id": "3d6af890-6411-49b2-a4fb-8a63ae520f78",
        "revision": "1",
        "description": {
          "title": "Prepare your workspace and materials"
        }
      }
    },
    {
      "step": {
        "id": "e87125b7-9ad1-4d9d-85c7-24765fab16c8",
        "revision": "1",
        "description": {
          "title": "Share your learning goals"
        }
      }
    }
  ],
  "returnEntity": true
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.steps.bulkUpdateSteps(steps, options)
 Description: Updates up to 100 steps in a single API call.  Each time a step is updated, `revision` increments by 1. The current `revision` must be passed when updating the step. This ensures you're working with the latest step and prevents unintended overwrites.  Use this method for content updates across multiple steps. To move a step within a section or to another section, call [MoveStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/move-step.md).  To update a single step, call [UpdateStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/update-step.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  steps, steps.step._id, steps.step.revision
 Method parameters: 
   param name: options | type: BulkUpdateStepsOptions  none  
        - name: returnEntity | type: boolean | description: Whether to return updated steps in the response.  
   param name: steps | type: array<array> | description: Steps to update. | required: true | validation: minItems 1, maxItems 100
              - name: step | type: Step | description: Step to update. May be partial.  
                 - ONE-OF: 
                    - name: videoOptions | type: VideoOptions | description: Video-specific settings.  
                       - ONE-OF: 
                          - name: wixVideo | type: WixVideo | description: Video from Wix Video.  
                             - name: _id | type: string | description: Wix Video GUID.  | validation: format GUID
                             - name: paid | type: boolean | description: Whether the Wix Video is paid content.  
                          - name: video | type: string | description: Video uploaded with Media Manager.  
                       - name: requiredCompletionPercentage | type: number | description: Percentage of the video that must be watched to complete the step.  
                       - name: coverImage | type: string | description: Cover image for the video.  
                       - name: durationInMilliseconds | type: integer | description: Video duration in milliseconds.  | validation: format int32
                       - name: deleted | type: boolean | description: Whether the uploaded video was deleted from Media Manager.  
                    - name: quizOptions | type: QuizOptions | description: Quiz-specific settings.  
                       - name: passingGrade | type: number | description: Minimum percentage required to pass the quiz.  
                 - name: _id | type: string | description: Step GUID. | required: true | read-only: true | validation: format GUID
                 - name: revision | type: string | description: Revision number, which increments by 1 each time the step is updated. To prevent conflicting changes, the current `revision` must be passed when updating the step. | required: true | read-only: true | validation: format int64
                 - name: description | type: Description | description: Step title, rich text content, and optional media.  
                    - ONE-OF: 
                       - name: image | type: string | description: Image displayed with the step content.  
                       - name: video | type: string | description: Video displayed with the step content.  
                    - name: title | type: string | description:   | validation: maxLength 250
                    - name: details | type: string | description:   | validation: maxLength 1000000
                 - name: ordering | type: number | description: Step position within the section.  
                 - name: stepType | type: StepType | description: Type of content in the step.  
                         - enum:
                         -     ARTICLE: Text-based step.
                         -     VIDEO: Step with video content.
                         -     QUIZ: Step linked to a quiz.
                 - name: extendedFields | type: ExtendedFields | description: Custom field data for the step object.  
                    - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
              - name: fieldMask | type: array<string> | description: Explicit list of fields to update.  
 Return type: PROMISE<BulkUpdateStepsResponse>
  - name: results | type: array<BulkUpdateStepResult> | description:   | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata for the processed step.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  | validation: format GUID
        - 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: Step | description: Updated step. Returned only when `returnEntity` is `true`.  
        - ONE-OF: 
           - name: videoOptions | type: VideoOptions | description: Video-specific settings.  
              - ONE-OF: 
                 - name: wixVideo | type: WixVideo | description: Video from Wix Video.  
                    - name: _id | type: string | description: Wix Video GUID.  | validation: format GUID
                    - name: paid | type: boolean | description: Whether the Wix Video is paid content.  
                 - name: video | type: string | description: Video uploaded with Media Manager.  
              - name: requiredCompletionPercentage | type: number | description: Percentage of the video that must be watched to complete the step.  
              - name: coverImage | type: string | description: Cover image for the video.  
              - name: durationInMilliseconds | type: integer | description: Video duration in milliseconds.  | validation: format int32
              - name: deleted | type: boolean | description: Whether the uploaded video was deleted from Media Manager.  
           - name: quizOptions | type: QuizOptions | description: Quiz-specific settings.  
              - name: _id | type: string | description: Quiz GUID. Provide it when creating a quiz step. After creation, the quiz reference can't be changed.  | read-only: true | validation: format GUID, immutable
              - name: totalQuestions | type: integer | description: Total number of questions in the quiz.  | read-only: true 
              - name: passingGrade | type: number | description: Minimum percentage required to pass the quiz.  
        - name: _id | type: string | description: Step GUID.  | read-only: true | validation: format GUID
        - name: revision | type: string | description: Revision number, which increments by 1 each time the step is updated. To prevent conflicting changes, the current `revision` must be passed when updating the step.  | read-only: true | validation: format int64
        - name: _createdDate | type: Date | description: Date and time the step was created.  | read-only: true 
        - name: _updatedDate | type: Date | description: Date and time the step was updated.  | read-only: true 
        - name: sectionId | type: string | description: Parent section GUID. To move a step within a section or to another section, call `MoveStep`.  | read-only: true | validation: format GUID
        - name: description | type: Description | description: Step title, rich text content, and optional media.  
           - ONE-OF: 
              - name: image | type: string | description: Image displayed with the step content.  
              - name: video | type: string | description: Video displayed with the step content.  
           - name: title | type: string | description:   | validation: maxLength 250
           - name: details | type: string | description:   | validation: maxLength 1000000
        - name: ordering | type: number | description: Step position within the section.  
        - name: stepType | type: StepType | description: Type of content in the step.  
             - enum:
             -     ARTICLE: Text-based step.
             -     VIDEO: Step with video content.
             -     QUIZ: Step linked to a quiz.
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the step object.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
        - name: programId | type: string | description: Program GUID.  | read-only: true | validation: format GUID
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk action.  
     - 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

### Update multiple step titles
```javascript
import { steps } from "@wix/online-programs";

const bulkUpdateStepsResponse = await steps.bulkUpdateSteps(
  [
    {
      step: {
        _id: "3d6af890-6411-49b2-a4fb-8a63ae520f78",
        revision: "1",
        description: {
          title: "Prepare your workspace and materials",
        },
      },
    },
    {
      step: {
        _id: "e87125b7-9ad1-4d9d-85c7-24765fab16c8",
        revision: "1",
        description: {
          title: "Share your learning goals",
        },
      },
    },
  ],
  { returnEntity: true },
);

/* Promise resolves to:
{
  "results": [
    {
      "itemMetadata": {
        "_id": "3d6af890-6411-49b2-a4fb-8a63ae520f78",
        "originalIndex": 0,
        "success": true
      },
      "item": {
        "_id": "3d6af890-6411-49b2-a4fb-8a63ae520f78",
        "revision": "2",
        "description": {
          "title": "Prepare your workspace and materials"
        },
        "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
        "ordering": 20,
        "stepType": "ARTICLE",
        "programId": "9a76e7d5-235a-4821-8f36-2d8bd0e7e9c1"
      }
    },
    {
      "itemMetadata": {
        "_id": "e87125b7-9ad1-4d9d-85c7-24765fab16c8",
        "originalIndex": 1,
        "success": true
      },
      "item": {
        "_id": "e87125b7-9ad1-4d9d-85c7-24765fab16c8",
        "revision": "2",
        "description": {
          "title": "Share your learning goals"
        },
        "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
        "ordering": 30,
        "stepType": "ARTICLE",
        "programId": "9a76e7d5-235a-4821-8f36-2d8bd0e7e9c1"
      }
    }
  ],
  "bulkActionMetadata": {
    "totalSuccesses": 2,
    "totalFailures": 0,
    "undetailedFailures": 0
  }
}
*/

```

### bulkUpdateSteps (self-hosted)
Self-hosted 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 { steps } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function bulkUpdateSteps(steps,options) {
  const response = await myWixClient.steps.bulkUpdateSteps(steps,options);
};
```

---