> 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 # CreateInstructor # Package: onlinePrograms # Namespace: InstructorsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/instructor-v2/create-instructor.md ## Permission Scopes: Manage Challenges: SCOPE.CHALLENGES.MANAGE ## Introduction Creates a new instructor --- ## REST API ### Schema ``` Method: createInstructor Description: Creates a new instructor URL: https://www.wixapis.com/v2/instructors Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: instructor.name Method parameters: param name: actionId | type: actionId | description: trace id used by BI. param name: instructor | type: Instructor | description: Instructor entity - name: name | type: string | description: The name of the instructor | required: true - 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: CreateInstructorResponse - name: instructor | type: Instructor | description: The created 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 ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlinePrograms.InstructorsService.createInstructor(options) Description: Creates a new instructor # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: options.instructor.name Method parameters: param name: options | type: CreateInstructorOptions none - name: instructor | type: Instructor | description: Instructor to be created - name: name | type: string | description: The name of the instructor | required: true - 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: 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 ``` ### Examples ### createInstructor ```javascript import { instructors } from '@wix/online-programs'; async function createInstructor(options) { const response = await instructors.createInstructor(options); }; ``` ### createInstructor (with elevated permissions) ```javascript import { instructors } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myCreateInstructorMethod(options) { const elevatedCreateInstructor = auth.elevate(instructors.createInstructor); const response = await elevatedCreateInstructor(options); } ``` ### createInstructor (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 createInstructor(options) { const response = await myWixClient.instructors.createInstructor(options); }; ``` ---