> 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

# UpdateStep

# Package: onlinePrograms

# Namespace: StepsService

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

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

## Introduction

Updates a step.

Each time the 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 to update step content and quiz settings.
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) instead of updating `step.sectionId`.
The quiz linked to a step can't be changed after the step is created.

Follow these requirements when updating video or quiz settings.

- When updating `step.videoOptions`, set `step.stepType` to `VIDEO`. To keep the existing source, omit `step.videoOptions.video` and `step.videoOptions.wixVideo`.
When reusing the source, a mask that selects all of `videoOptions` resets omitted settings such as the cover image and duration. It keeps `deleted` unless the mask also selects `videoOptions.deleted` explicitly. Select a subfield such as `videoOptions.requiredCompletionPercentage` to change only that setting.
- When updating `step.quizOptions.passingGrade`, set `step.stepType` to `QUIZ`. You can omit `step.quizOptions.id` to keep the existing quiz reference.

To update multiple steps in a single API call, call [BulkUpdateSteps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-update-steps.md).

---

## REST API

### Schema

```
 Method: updateStep
 Description: Updates a step.  Each time the 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 to update step content and quiz settings. 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) instead of updating `step.sectionId`. The quiz linked to a step can't be changed after the step is created.  Follow these requirements when updating video or quiz settings.  - When updating `step.videoOptions`, set `step.stepType` to `VIDEO`. To keep the existing source, omit `step.videoOptions.video` and `step.videoOptions.wixVideo`. When reusing the source, a mask that selects all of `videoOptions` resets omitted settings such as the cover image and duration. It keeps `deleted` unless the mask also selects `videoOptions.deleted` explicitly. Select a subfield such as `videoOptions.requiredCompletionPercentage` to change only that setting. - When updating `step.quizOptions.passingGrade`, set `step.stepType` to `QUIZ`. You can omit `step.quizOptions.id` to keep the existing quiz reference.  To update multiple steps in a single API call, call [BulkUpdateSteps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-update-steps.md).
 URL: https://www.wixapis.com/online-programs/v3/steps/{step.id}
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  step, step.id, step.revision
 Method parameters: 
   param name: step | type: Step | description: A step represents a piece of program content within a section. A step can contain article, video, or quiz content. | required: true 
    - ONE-OF: - required: true
     - 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: Completion percentage stored on this step. The Wix web participant page uses the program's `videoStepsSettings.requiredCompletionPercentage` for all video steps.  
        - 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.  
           - 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
 Return type: UpdateStepResponse
  - name: step | type: Step | description: Updated step.  
     - 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: Completion percentage stored on this step. The Wix web participant page uses the program's `videoStepsSettings.requiredCompletionPercentage` for all video steps.  
           - 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.  
        - 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

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: QUIZ_SITE_LIMIT_REACHED | Description: The site has reached its maximum number of quiz steps.


```

### Examples

### Update a step
Updates a step title while preserving its current position.

```curl
curl -X PATCH \
'https://www.wixapis.com/online-programs/v3/steps/c5f91a8e-1e8b-4f6f-9da2-2d715874e91c' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "step": {
    "revision": "1",
    "description": {
      "title": "Welcome to week 1: updated"
    }
  }
}'
```

### Add an image to a step's content
Displays an image with an article step by adding an `IMAGE` node to the Ricos rich content in `description.details`. The image must already exist in the site's Media Manager; pass its file ID in `imageData.image.src.id` together with the file's `width` and `height`. Images set anywhere else on the step aren't displayed.

```curl
curl -X PATCH \
'https://www.wixapis.com/online-programs/v3/steps/c5f91a8e-1e8b-4f6f-9da2-2d715874e91c' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "step": {
    "revision": "2",
    "description": {
      "details": "{\"nodes\":[{\"type\":\"PARAGRAPH\",\"id\":\"yyovb1\",\"nodes\":[{\"type\":\"TEXT\",\"id\":\"\",\"nodes\":[],\"textData\":{\"text\":\"Review the weekly plan and complete the first assignment.\",\"decorations\":[]}}],\"paragraphData\":{\"textStyle\":{\"textAlignment\":\"AUTO\"}}},{\"type\":\"IMAGE\",\"id\":\"img1\",\"nodes\":[],\"imageData\":{\"containerData\":{\"width\":{\"size\":\"CONTENT\"},\"alignment\":\"CENTER\"},\"image\":{\"src\":{\"id\":\"11062b_6a2f1d3f62db4cfda7849f78ef84f92b~mv2.jpg\"},\"width\":1920,\"height\":1080},\"altText\":\"Notebook and pen prepared for the first lesson\"}}],\"metadata\":{\"version\":1}}"
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.steps.updateStep(_id, step)
 Description: Updates a step.  Each time the 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 to update step content and quiz settings. 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) instead of updating `step.sectionId`. The quiz linked to a step can't be changed after the step is created.  Follow these requirements when updating video or quiz settings.  - When updating `step.videoOptions`, set `step.stepType` to `VIDEO`. To keep the existing source, omit `step.videoOptions.video` and `step.videoOptions.wixVideo`. When reusing the source, a mask that selects all of `videoOptions` resets omitted settings such as the cover image and duration. It keeps `deleted` unless the mask also selects `videoOptions.deleted` explicitly. Select a subfield such as `videoOptions.requiredCompletionPercentage` to change only that setting. - When updating `step.quizOptions.passingGrade`, set `step.stepType` to `QUIZ`. You can omit `step.quizOptions.id` to keep the existing quiz reference.  To update multiple steps in a single API call, call [BulkUpdateSteps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-update-steps.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  step, _id, step.revision
 Method parameters: 
   param name: _id | type: string | description: Step GUID. | required: true | validation: format GUID
   param name: step | type: UpdateStep | description: A step represents a piece of program content within a section. A step can contain article, video, or quiz content. | required: true 
    - ONE-OF: - required: true
     - 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: Completion percentage stored on this step. The Wix web participant page uses the program's `videoStepsSettings.requiredCompletionPercentage` for all video steps.  
        - 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: 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.  
           - 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
 Return type: PROMISE<Step>
  - 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: Completion percentage stored on this step. The Wix web participant page uses the program's `videoStepsSettings.requiredCompletionPercentage` for all video steps.  
        - 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.  
     - 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

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: QUIZ_SITE_LIMIT_REACHED | Description: The site has reached its maximum number of quiz steps.


```

### Examples

### Add an image to a step's content
```javascript
import { steps } from "@wix/online-programs";

// Ricos rich content: a paragraph followed by an image node.
// `src.id` is the Media Manager file ID of an image that already exists on the site.
// Images set anywhere else on the step aren't displayed.
const richContent = {
  nodes: [
    {
      type: "PARAGRAPH",
      id: "yyovb1",
      nodes: [
        {
          type: "TEXT",
          id: "",
          nodes: [],
          textData: {
            text: "Review the weekly plan and complete the first assignment.",
            decorations: [],
          },
        },
      ],
      paragraphData: { textStyle: { textAlignment: "AUTO" } },
    },
    {
      type: "IMAGE",
      id: "img1",
      nodes: [],
      imageData: {
        containerData: { width: { size: "CONTENT" }, alignment: "CENTER" },
        image: {
          src: { id: "11062b_6a2f1d3f62db4cfda7849f78ef84f92b~mv2.jpg" },
          width: 1920,
          height: 1080,
        },
        altText: "Notebook and pen prepared for the first lesson",
      },
    },
  ],
  metadata: { version: 1 },
};

const step = await steps.updateStep(
  "c5f91a8e-1e8b-4f6f-9da2-2d715874e91c",
  {
    revision: "2",
    description: {
      details: JSON.stringify(richContent),
    },
  },
);

/* Promise resolves to:
{
  "_id": "c5f91a8e-1e8b-4f6f-9da2-2d715874e91c",
  "revision": "3",
  "_createdDate": "2026-08-18T09:50:12.557Z",
  "_updatedDate": "2026-08-18T10:04:31.882Z",
  "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
  "description": {
    "title": "Welcome to week 1: updated",
    "details": "{\"nodes\":[{\"type\":\"PARAGRAPH\",\"id\":\"yyovb1\",\"nodes\":[{\"type\":\"TEXT\",\"id\":\"\",\"nodes\":[],\"textData\":{\"text\":\"Review the weekly plan and complete the first assignment.\",\"decorations\":[]}}],\"paragraphData\":{\"textStyle\":{\"textAlignment\":\"AUTO\"}}},{\"type\":\"IMAGE\",\"id\":\"img1\",\"nodes\":[],\"imageData\":{\"containerData\":{\"width\":{\"size\":\"CONTENT\"},\"alignment\":\"CENTER\"},\"image\":{\"src\":{\"id\":\"11062b_6a2f1d3f62db4cfda7849f78ef84f92b~mv2.jpg\"},\"width\":1920,\"height\":1080},\"altText\":\"Notebook and pen prepared for the first lesson\"}}],\"metadata\":{\"version\":1}}"
  },
  "ordering": 10,
  "stepType": "ARTICLE",
  "programId": "9a76e7d5-235a-4821-8f36-2d8bd0e7e9c1"
}
*/

```

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

const step = await steps.updateStep(
  "c5f91a8e-1e8b-4f6f-9da2-2d715874e91c",
  {
    revision: "1",
    description: {
      title: "Welcome to week 1: updated",
    },
  },
);

/* Promise resolves to:
{
  "_id": "c5f91a8e-1e8b-4f6f-9da2-2d715874e91c",
  "revision": "2",
  "_createdDate": "2026-08-18T09:50:12.557Z",
  "_updatedDate": "2026-08-18T09:52:44.019Z",
  "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
  "description": {
    "title": "Welcome to week 1: updated",
    "details": "{\"nodes\":[{\"type\":\"PARAGRAPH\",\"id\":\"yyovb1\",\"nodes\":[{\"type\":\"TEXT\",\"id\":\"\",\"nodes\":[],\"textData\":{\"text\":\"Review the weekly plan and complete the first assignment.\",\"decorations\":[]}}],\"paragraphData\":{\"textStyle\":{\"textAlignment\":\"AUTO\"}}}],\"metadata\":{\"version\":1,\"createdTimestamp\":\"2026-08-18T09:50:12.557Z\",\"updatedTimestamp\":\"2026-08-18T09:50:12.557Z\",\"id\":\"58274b83-13b8-486c-b28f-ab65667ef0bf\"}}"
  },
  "ordering": 10,
  "stepType": "ARTICLE",
  "programId": "9a76e7d5-235a-4821-8f36-2d8bd0e7e9c1"
}
*/

```

### updateStep (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 { 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 updateStep(_id,step) {
  const response = await myWixClient.steps.updateStep(_id,step);
};
```

---