> 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 # DuplicateProgram # Package: programs # Namespace: ProgramsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/programs/program/duplicate-program.md ## Permission Scopes: Manage Challenges: SCOPE.CHALLENGES.MANAGE ## Introduction Duplicates the Program. Leaves certificate template, but removes social group. --- ## REST API ### Schema ``` Method: duplicateProgram Description: Duplicates the Program. Leaves certificate template, but removes social group. URL: https://www.wixapis.com/v3/programs/{programId}/duplicate Method: POST Return type: DuplicateProgramResponse - name: program | type: Program | description: The created Program. - name: id | type: string | description: Program GUID. - name: revision | type: string | description: - name: createdDate | type: string | description: - name: updatedDate | type: string | description: - name: status | type: Status | description: current program state in v2 format - enum: - DRAFT: not published program, visible only on BM - PUBLISHED: program visible regarding to restrictions - ENDED: program isn't available to join. - ARCHIVED: closed program. Joins and sections/steps are not available for participants. - name: categoryIds | type: array | description: assigned categories - name: description | type: Description | description: general program info. - ONE-OF: - name: image | type: Image | description: WixMedia image - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image filename. - name: video | type: VideoV2 | description: WixMedia video - name: id | type: string | description: WixMedia GUID. - name: resolutions | type: array | description: Available resolutions for the video, starting with the optimal resolution. - 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. - name: title | type: string | description: - name: details | type: string | description: - name: timeline | type: Timeline | description: timeline type -> Self-paced, time-restricted. - name: selfPaced | type: boolean | description: are sections/steps evaluated every day? Or can UoU participate in a self paced mode? - name: startDate | type: string | description: everyone starts on this day - name: durationInDays | type: integer | description: duration of program in days (if applicable). - name: restrictions | type: Restrictions | description: participant limitation, step-completion pace and etc. - name: maxParticipants | type: integer | description: limit of active participants in the program. - name: hideFutureSteps | type: boolean | description: hide steps in the Pending state. - name: resolveStepsInOrder | type: boolean | description: allow participants complete steps in the certain order. - name: shareProgress | type: boolean | description: allow program participants to share their progress in group - name: accessType | type: AccessType | description: access restrictions options regarding visibility. - enum: - PUBLIC: join without approvals - PRIVATE: send a join request to the owner and get an approval from him. - SECRET: join possible only after owner invite. - name: price | type: Money | description: single-payment price. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: seo | type: Seo | description: seo settings. - name: slug | type: string | description: program slug expression - name: seoData | type: SeoSchema | description: schema used by Seo team - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: url | type: PageUrl | description: program url - name: base | type: string | description: The base URL. For premium sites, this is the domain. For free sites, this is the site URL. For example, `mysite.wixsite.com/mysite`. - name: path | type: string | description: The relative path for the page within the site. For example, `/product-page/a-product`. - name: imageUrl | type: string | description: image url from description media - name: imageAlt | type: string | description: alt text of image - name: courseWorkload | type: string | description: Approximate SEO program duration in Iso-8601 - name: rewards | type: array | description: rewards to be assigned after reaching some of the program milestones. - name: trigger | type: Trigger | description: on which action rewards must be assigned. - enum: - JOINED_TO_PROGRAM: member joins the program - STEP_COMPLETED: at least one step completed - ALL_STEPS_COMPLETED: all steps are completed. - name: badgeIds | type: array | description: badges participant will get on program complete - name: certificate | type: Certificate | description: certificate for program. Currently is program GUID - name: id | type: string | description: Certificate for program completion. Currently is program GUID - name: connectedDate | type: string | description: date it was connected to program - name: socialGroupId | type: string | description: connected social group. - name: extendedFields | type: ExtendedFields | description: extensible field - 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). - name: shouldSendInvoice | type: boolean | description: if true -> invoice is sent to the customer who purchased the program via single payment; else -> payment confirmation email is sent - name: videoStepsSettings | type: VideoStepsSettings | description: settings related to video steps in programs - name: autoNavigate | type: boolean | description: automatically switch to next video step after finishing current one - name: requiredCompletionPercentage | type: number | description: how many percents of video need to be watched to complete step - name: contentSummary | type: ContentSummary | description: number of content entities in program - name: stepCount | type: integer | description: number of steps in program - name: sectionCount | type: integer | description: number of sections in program - name: ownerUserId | type: string | description: user id of owner, who created this program ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.programs.ProgramsService.duplicateProgram(programId) Description: Duplicates the Program. Leaves certificate template, but removes social group. # 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: programId | type: string | description: Program to be duplicated from. | required: true Return type: PROMISE - name: program | type: Program | description: The created Program. - name: _id | type: string | description: Program GUID. - name: revision | type: string | description: - name: _createdDate | type: Date | description: - name: _updatedDate | type: Date | description: - name: status | type: Status | description: current program state in v2 format - enum: - DRAFT: not published program, visible only on BM - PUBLISHED: program visible regarding to restrictions - ENDED: program isn't available to join. - ARCHIVED: closed program. Joins and sections/steps are not available for participants. - name: categoryIds | type: array | description: assigned categories - name: description | type: Description | description: general program info. - ONE-OF: - name: image | type: string | description: WixMedia image - name: video | type: string | description: WixMedia video - name: title | type: string | description: - name: details | type: string | description: - name: timeline | type: Timeline | description: timeline type -> Self-paced, time-restricted. - name: selfPaced | type: boolean | description: are sections/steps evaluated every day? Or can UoU participate in a self paced mode? - name: startDate | type: string | description: everyone starts on this day - name: durationInDays | type: integer | description: duration of program in days (if applicable). - name: restrictions | type: Restrictions | description: participant limitation, step-completion pace and etc. - name: maxParticipants | type: integer | description: limit of active participants in the program. - name: hideFutureSteps | type: boolean | description: hide steps in the Pending state. - name: resolveStepsInOrder | type: boolean | description: allow participants complete steps in the certain order. - name: shareProgress | type: boolean | description: allow program participants to share their progress in group - name: accessType | type: AccessType | description: access restrictions options regarding visibility. - enum: - PUBLIC: join without approvals - PRIVATE: send a join request to the owner and get an approval from him. - SECRET: join possible only after owner invite. - name: price | type: Money | description: single-payment price. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: seo | type: Seo | description: seo settings. - name: slug | type: string | description: program slug expression - name: seoData | type: SeoSchema | description: schema used by Seo team - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: url | type: string | description: program url - name: imageUrl | type: string | description: image url from description media - name: imageAlt | type: string | description: alt text of image - name: courseWorkload | type: string | description: Approximate SEO program duration in Iso-8601 - name: rewards | type: array | description: rewards to be assigned after reaching some of the program milestones. - name: trigger | type: Trigger | description: on which action rewards must be assigned. - enum: - JOINED_TO_PROGRAM: member joins the program - STEP_COMPLETED: at least one step completed - ALL_STEPS_COMPLETED: all steps are completed. - name: badgeIds | type: array | description: badges participant will get on program complete - name: certificate | type: Certificate | description: certificate for program. Currently is program GUID - name: _id | type: string | description: Certificate for program completion. Currently is program GUID - name: connectedDate | type: Date | description: date it was connected to program - name: socialGroupId | type: string | description: connected social group. - name: extendedFields | type: ExtendedFields | description: extensible field - 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). - name: shouldSendInvoice | type: boolean | description: if true -> invoice is sent to the customer who purchased the program via single payment; else -> payment confirmation email is sent - name: videoStepsSettings | type: VideoStepsSettings | description: settings related to video steps in programs - name: autoNavigate | type: boolean | description: automatically switch to next video step after finishing current one - name: requiredCompletionPercentage | type: number | description: how many percents of video need to be watched to complete step - name: contentSummary | type: ContentSummary | description: number of content entities in program - name: stepCount | type: integer | description: number of steps in program - name: sectionCount | type: integer | description: number of sections in program - name: ownerUserId | type: string | description: user id of owner, who created this program ``` ### Examples ### duplicateProgram ```javascript import { programs } from '@wix/online-programs'; async function duplicateProgram(programId) { const response = await programs.duplicateProgram(programId); }; ``` ### duplicateProgram (with elevated permissions) ```javascript import { programs } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myDuplicateProgramMethod(programId) { const elevatedDuplicateProgram = auth.elevate(programs.duplicateProgram); const response = await elevatedDuplicateProgram(programId); } ``` ### duplicateProgram (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 { programs } from '@wix/online-programs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { programs }, // Include the auth strategy and host as relevant }); async function duplicateProgram(programId) { const response = await myWixClient.programs.duplicateProgram(programId); }; ``` ---