> 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 # ListInstructors # Package: onlinePrograms # Namespace: InstructorsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/instructor-v2/list-instructors.md ## Permission Scopes: Manage Challenges: SCOPE.CHALLENGES.MANAGE ## Introduction Lists instructors created on the site --- ## REST API ### Schema ``` Method: listInstructors Description: Lists instructors created on the site URL: https://www.wixapis.com/v2/instructors/list Method: POST Method parameters: param name: paging | type: Paging - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. param name: programIdsFilter | type: array | description: Filter instructors assigned to specified programs. Return all instructors if this field has empty value Return type: ListInstructorsResponse - name: instructors | type: array | description: Retrieved instructors - name: id | type: string | description: GUID of the instructor that equals to memberId - name: userId | type: string | description: User GUID for real instructors (will be filled only for real instructors) - name: name | type: string | description: The name of the instructor - name: description | type: string | description: A description of the instructor - name: photo | type: Image | description: URL of profile photo - name: id | type: string | description: Wix Media image GUID, set when the member selects an image from Wix Media. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image width. - name: width | type: integer | description: Original image height. - name: offsetX | type: integer | description: X-axis offset. Default: `0`. - name: offsetY | type: integer | description: Y-axis offset. Default: `0`. - name: photoAltText | type: string | description: Alt text for profile photo (needed for a11y) - name: slug | type: string | description: Slug that determines the instructor's profile page URL. - name: role | type: Role | description: Role of the instructor - enum: - DEFAULT: VIRTUAL instructor - OWNER: REAL instructor who is the owner of the site - INSTRUCTOR: REAL instructor who has access to specified list of programs - MANAGER: REAL instructor who has the same rights as program owner - name: programIds | type: array | description: IDs of programs instructor is assigned to - name: createdDate | type: string | description: Date and time when the instructor was created - name: paging | type: PagingMetadataV2 | description: paging metadata - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: metadata | type: PagingMetadataV2 | description: paging metadata ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlinePrograms.InstructorsService.listInstructors(options) Description: Lists instructors created on the site Method parameters: param name: options | type: ListInstructorsOptions none - name: programIdsFilter | type: array | description: Filter instructors assigned to specified programs. Return all instructors if this field has empty value - name: paging | type: Paging | description: page - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. Return type: PROMISE - name: instructors | type: array | description: Retrieved instructors - name: _id | type: string | description: GUID of the instructor that equals to memberId - name: userId | type: string | description: User GUID for real instructors (will be filled only for real instructors) - name: name | type: string | description: The name of the instructor - name: description | type: string | description: A description of the instructor - name: photo | type: Image | description: URL of profile photo - name: _id | type: string | description: Wix Media image GUID, set when the member selects an image from Wix Media. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image width. - name: width | type: integer | description: Original image height. - name: offsetX | type: integer | description: X-axis offset. Default: `0`. - name: offsetY | type: integer | description: Y-axis offset. Default: `0`. - name: photoAltText | type: string | description: Alt text for profile photo (needed for a11y) - name: slug | type: string | description: Slug that determines the instructor's profile page URL. - name: role | type: Role | description: Role of the instructor - enum: - DEFAULT: VIRTUAL instructor - OWNER: REAL instructor who is the owner of the site - INSTRUCTOR: REAL instructor who has access to specified list of programs - MANAGER: REAL instructor who has the same rights as program owner - name: programIds | type: array | description: IDs of programs instructor is assigned to - name: _createdDate | type: Date | description: Date and time when the instructor was created - name: paging | type: PagingMetadataV2 | description: paging metadata - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: metadata | type: PagingMetadataV2 | description: paging metadata ``` ### Examples ### listInstructors ```javascript import { instructors } from '@wix/online-programs'; async function listInstructors(options) { const response = await instructors.listInstructors(options); }; ``` ### listInstructors (with elevated permissions) ```javascript import { instructors } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myListInstructorsMethod(options) { const elevatedListInstructors = auth.elevate(instructors.listInstructors); const response = await elevatedListInstructors(options); } ``` ### listInstructors (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 { instructors } from '@wix/online-programs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { instructors }, // Include the auth strategy and host as relevant }); async function listInstructors(options) { const response = await myWixClient.instructors.listInstructors(options); }; ``` ---