> 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

# QuerySteps

# Package: onlinePrograms

# Namespace: StepsService

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

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

## Introduction

Retrieves a list of steps, given the provided paging, filtering, and sorting.

Query Steps runs with these defaults, which you can override:

- `createdDate` is sorted in `DESC` order.
- `paging.offset` is `0`.

For predictable response sizes, we recommend setting `paging.limit` up to `100`.

If your app is already scoped to a specific program, pass `programId` in addition to the query filters. `programId` adds program context to the request and doesn't replace section-based filtering in `query`.
Supported sorting fields are `createdDate`, `id`, `programId`, and `ordering`. When sorting by `ordering`, also filter by `sectionId`.
Use `descriptionFieldSet` to control how much description content to return.
Some returned fields depend on the caller's permissions.

To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).

---

## REST API

### Schema

```
 Method: querySteps
 Description: Retrieves a list of steps, given the provided paging, filtering, and sorting.  Query Steps runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order. - `paging.offset` is `0`.  For predictable response sizes, we recommend setting `paging.limit` up to `100`.  If your app is already scoped to a specific program, pass `programId` in addition to the query filters. `programId` adds program context to the request and doesn't replace section-based filtering in `query`. Supported sorting fields are `createdDate`, `id`, `programId`, and `ordering`. When sorting by `ordering`, also filter by `sectionId`. Use `descriptionFieldSet` to control how much description content to return. Some returned fields depend on the caller's permissions.  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 URL: https://www.wixapis.com/online-programs/v3/steps/query
 Method: POST
 Method parameters:
   param name: descriptionFieldSet | type: DescriptionFieldSet    
      - enum:
           STANDARD - Returns the standard step description fields.
           EXTENDED - Returns additional step description fields when they're available to the caller.
   param name: programId | type: programId | description: Program GUID.  | validation: minLength 0, maxLength 36
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 500, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  | validation: format double
              - name: longitude | type: number | description: Address longitude.  | validation: format double
 Query fields:
   - field: sectionId | operators: $eq, $in | sort: none | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: ordering | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryStepsResponse
  - name: steps | type: array<Step> | description: Retrieved steps.  
     - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query steps
Retrieves steps in a section using cursor-based paging.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/v3/steps/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d"
    },
    "sort": [
      {
        "fieldName": "ordering",
        "order": "ASC"
      }
    ],
    "cursorPaging": {
      "limit": 10
    }
  },
  "descriptionFieldSet": "EXTENDED"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.steps.querySteps(query, options)
 Description: Retrieves a list of steps, given the provided paging, filtering, and sorting.  Query Steps runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order. - `paging.offset` is `0`.  For predictable response sizes, we recommend setting `paging.limit` up to `100`.  If your app is already scoped to a specific program, pass `programId` in addition to the query filters. `programId` adds program context to the request and doesn't replace section-based filtering in `query`. Supported sorting fields are `createdDate`, `id`, `programId`, and `ordering`. When sorting by `ordering`, also filter by `sectionId`. Use `descriptionFieldSet` to control how much description content to return. Some returned fields depend on the caller's permissions.  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: options | type: QueryStepsOptions  none  
        - name: descriptionFieldSet | type: DescriptionFieldSet | description: Predefined set of description fields to return.  
             - enum:
             -     STANDARD: Returns the standard step description fields.
             -     EXTENDED: Returns additional step description fields when they're available to the caller.
        - name: programId | type: string | description: Program GUID.  | validation: minLength 0, maxLength 36
   param name: query | type: StepQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 500, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
 Query fields:
   - field: sectionId | operators: $eq, $in | sort: none | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: ordering | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryStepsResponse>
  - name: steps | type: array<Step> | description: Retrieved steps.  
     - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query steps in a section
```javascript
import { steps } from "@wix/online-programs";

const stepsPage = await steps.querySteps(
  {
    filter: {
      sectionId: "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
    },
    sort: [
      {
        fieldName: "ordering",
        order: "ASC",
      },
    ],
    cursorPaging: {
      limit: 10,
    },
  },
  { descriptionFieldSet: "EXTENDED" },
);

/* Promise resolves to:
{
  "steps": [
    {
      "_id": "3d6af890-6411-49b2-a4fb-8a63ae520f78",
      "revision": "2",
      "_createdDate": "2026-08-18T09:54:08.770Z",
      "_updatedDate": "2026-08-18T09:55:31.214Z",
      "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
      "description": {
        "title": "Prepare your workspace and materials",
        "details": "Set up the tools and materials you need before starting."
      },
      "ordering": 20,
      "stepType": "ARTICLE",
      "programId": "9a76e7d5-235a-4821-8f36-2d8bd0e7e9c1"
    },
    {
      "_id": "e87125b7-9ad1-4d9d-85c7-24765fab16c8",
      "revision": "2",
      "_createdDate": "2026-08-18T09:54:08.770Z",
      "_updatedDate": "2026-08-18T09:55:31.214Z",
      "sectionId": "b142d26b-2c56-4b85-9f8d-6bea0920eb4d",
      "description": {
        "title": "Share your learning goals",
        "details": "Write down the outcome you want to achieve this week."
      },
      "ordering": 30,
      "stepType": "ARTICLE",
      "programId": "9a76e7d5-235a-4821-8f36-2d8bd0e7e9c1"
    }
  ],
  "pagingMetadata": {
    "count": 2,
    "cursors": {},
    "hasNext": false
  }
}
*/

```

### querySteps (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 querySteps(query,options) {
  const response = await myWixClient.steps.querySteps(query,options);
};
```

---