> 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 # UpdateInstructor # Package: onlinePrograms # Namespace: InstructorsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/instructor-v2/update-instructor.md ## Permission Scopes: Manage Challenges: SCOPE.CHALLENGES.MANAGE ## Introduction Updates an instructor, supports partial update --- ## REST API ### Schema ``` Method: updateInstructor Description: Updates an instructor, supports partial update URL: https://www.wixapis.com/v2/instructors/{instructor.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: instructor, instructor.id Method parameters: param name: actionId | type: actionId | description: trace id used by BI. param name: instructor | type: Instructor | description: Instructor entity | required: true - name: id | type: string | description: GUID of the instructor that equals to memberId | required: true - 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) Return type: UpdateInstructorResponse - name: instructor | type: Instructor | description: Updated instructor - 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 Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: INVALID_IDENTITY | Description: none ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlinePrograms.InstructorsService.updateInstructor(_id, instructor, options) Description: Updates an instructor, supports partial update # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: instructor, _id Method parameters: param name: _id | type: string | description: GUID of the instructor that equals to memberId | required: true param name: instructor | type: UpdateInstructor | description: Instructor entity | required: true - 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) param name: options | type: UpdateInstructorOptions none - name: actionId | type: string | description: trace id used by BI. Return type: PROMISE - 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 Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: INVALID_IDENTITY | Description: none ``` ### Examples ### updateInstructor ```javascript import { instructors } from '@wix/online-programs'; async function updateInstructor(_id,instructor,options) { const response = await instructors.updateInstructor(_id,instructor,options); }; ``` ### updateInstructor (with elevated permissions) ```javascript import { instructors } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myUpdateInstructorMethod(_id,instructor,options) { const elevatedUpdateInstructor = auth.elevate(instructors.updateInstructor); const response = await elevatedUpdateInstructor(_id,instructor,options); } ``` ### updateInstructor (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 updateInstructor(_id,instructor,options) { const response = await myWixClient.instructors.updateInstructor(_id,instructor,options); }; ``` ---