> 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 # AssignInstructorToProgram # Package: onlinePrograms # Namespace: InstructorsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/instructor-v2/assign-instructor-to-program.md ## Permission Scopes: Manage Challenges: SCOPE.CHALLENGES.MANAGE ## Introduction Assigns an instructor to the program --- ## REST API ### Schema ``` Method: assignInstructorToProgram Description: Assigns an instructor to the program URL: https://www.wixapis.com/v2/instructors/{instructorId}/assign Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: programId Method parameters: param name: actionId | type: actionId | description: trace id used by BI. param name: programId | type: programId | description: GUID of the program | required: true Return type: AssignInstructorToProgramResponse EMPTY-OBJECT {} ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlinePrograms.InstructorsService.assignInstructorToProgram(instructorId, programId, options) Description: Assigns an instructor to the program # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: instructorId, programId Method parameters: param name: instructorId | type: string | description: GUID of the instructor to assign | required: true param name: options | type: AssignInstructorToProgramOptions none - name: actionId | type: string | description: trace id used by BI. param name: programId | type: string | description: GUID of the program | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### assignInstructorToProgram ```javascript import { instructors } from '@wix/online-programs'; async function assignInstructorToProgram(instructorId,programId,options) { const response = await instructors.assignInstructorToProgram(instructorId,programId,options); }; ``` ### assignInstructorToProgram (with elevated permissions) ```javascript import { instructors } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myAssignInstructorToProgramMethod(instructorId,programId,options) { const elevatedAssignInstructorToProgram = auth.elevate(instructors.assignInstructorToProgram); const response = await elevatedAssignInstructorToProgram(instructorId,programId,options); } ``` ### assignInstructorToProgram (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 assignInstructorToProgram(instructorId,programId,options) { const response = await myWixClient.instructors.assignInstructorToProgram(instructorId,programId,options); }; ``` ---