> ## Documentation Index
> Fetch the complete documentation index at: https://docs.schoolmaker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Duplicate a Program

> Duplicates a program without members and leaves the copy unpublished. Returns a background operation. Check its status until completed or failed.



## OpenAPI

````yaml post /products/{id}/duplicate
openapi: 3.0.1
info:
  title: SchoolMaker API V1
  description: API for managing your SchoolMaker school
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://schoolmaker.co/api/v1
    description: Production API
security:
  - bearerAuth: []
paths:
  /products/{id}/duplicate:
    post:
      tags:
        - Programs
      summary: Duplicate a Program
      description: >-
        Duplicates a program without members and leaves the copy unpublished.
        Returns a background operation. Check its status until completed or
        failed.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Program ID.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 10000
                  description: >-
                    Name of the copy, up to 255 characters. If omitted or empty,
                    uses the original name with the translated Copy of prefix;
                    the resulting name must fit this limit.
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Reuse the same key with identical request details to return
                    the existing operation. Different request details with the
                    same key return HTTP 422.
              additionalProperties: false
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 10000
                  description: >-
                    Name of the copy, up to 255 characters. If omitted or empty,
                    uses the original name with the translated Copy of prefix;
                    the resulting name must fit this limit.
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Reuse the same key with identical request details to return
                    the existing operation. Different request details with the
                    same key return HTTP 422.
              additionalProperties: false
      responses:
        '200':
          description: Existing duplication request. Check its status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramOperation'
        '202':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramOperation'
              example:
                id: OPERATION_ID
                operation: duplicate_program
                status: pending
                result: null
                error: null
        '401':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramError'
              example:
                error: Access denied
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramError'
              example:
                error: Forbidden
        '404':
          description: Record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramError'
              example:
                error: Record not found
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramError'
              example:
                error: Validation failed
components:
  schemas:
    ProgramOperation:
      type: object
      properties:
        id:
          type: string
        operation:
          type: string
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
        result:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              description: >-
                Program description. Returns an empty string when no description
                is set.
            is_published:
              type: boolean
            is_default_granularity_access_enabled:
              type: boolean
              nullable: true
            settings_store_url:
              type: string
              maxLength: 200000
              description: >-
                Link for the "Unlock" button shown to members without access to
                this program. We recommend linking to an offer that grants
                access. Omitted or null on creation leaves it empty. Send null
                or an empty string to clear it on update.
              nullable: true
            settings_show_member_count:
              type: boolean
              description: >-
                Show or hide the number of members in this program. Omitted or
                null on creation leaves it off and returns null. Send false to
                turn it off on update. An existing true or false value cannot be
                changed to null.
              nullable: true
            settings_is_certificate_enabled:
              type: boolean
              description: >-
                Give members a certificate when they complete all steps in this
                program. Omitted or null on creation leaves it off and returns
                null. Send false to turn it off on update. An existing true or
                false value cannot be changed to null.
              nullable: true
            settings_is_milestone_display_enabled:
              type: boolean
              description: >-
                Show or hide milestones in the program plan. Defaults to true
                when omitted or null on creation. Send null on update to restore
                this default.
              nullable: true
            settings_is_coaching_disabled:
              type: boolean
              nullable: true
            settings_is_section_groups_enabled:
              type: boolean
              description: >-
                Allow section groups. You may need to reorder sections after
                enabling this setting. Omitted or null on creation leaves it off
                and returns null. Send false to disable it or null to clear it.
              nullable: true
            is_secret:
              type: boolean
              description: >-
                Only members with access to a "secret program" can see it on the
                home page.
              nullable: true
            questions_category_id:
              type: string
              maxLength: 200000
              description: >-
                ID of an accessible question category in this school. Pair with
                questions_category_type.
              nullable: true
            questions_category_type:
              type: string
              maxLength: 200000
              description: >-
                Use Forums::Category for a community space or Meetings::Category
                for a consultation category. Must match questions_category_id.
              nullable: true
            settings_is_inline_questions_category:
              type: boolean
              nullable: true
            settings_is_questions_disabled:
              type: boolean
              nullable: true
            default_reviewer_ids:
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 255
              maxItems: 100
              description: >-
                Up to 100 staff user IDs to assign as reviewers for new steps.
                Defaults to an empty list on creation. Omit on update to keep
                the current list or send [] to clear it. Null is not accepted.
                Reviewers already assigned to existing steps are kept.
            id:
              type: string
            section_groups:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  position:
                    type: integer
            image_logo_url:
              type: string
              nullable: true
            image_cover_url:
              type: string
              nullable: true
          nullable: true
        error:
          type: string
          nullable: true
    ProgramError:
      type: object
      properties:
        error:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.