> ## 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 Section

> Duplicates a section and its lessons in the selected program. The copied section and lessons are unpublished. Returns a background operation. Check its status until completed or failed.



## OpenAPI

````yaml post /sections/{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:
  /sections/{id}/duplicate:
    post:
      tags:
        - Sections
      summary: Duplicate a Section
      description: >-
        Duplicates a section and its lessons in the selected program. The copied
        section and lessons are unpublished. Returns a background operation.
        Check its status until completed or failed.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: >-
                    Name of the copy, up to 255 characters. Omitted or empty
                    uses Copy of followed by the original name, in the school
                    language. The complete name must fit the 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.
                destination_program_id:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Destination program ID. Defaults to the source program. You
                    need edit access to both programs.
                destination_section_group_id:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Group ID within the destination program. Defaults to that
                    program's last group.
              additionalProperties: false
      responses:
        '200':
          description: Previously completed duplication request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  operation:
                    type: string
                  status:
                    type: string
                    enum:
                      - pending
                      - running
                      - completed
                      - failed
                  result:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                      product_id:
                        type: string
                      section_group_id:
                        type: string
                        nullable: true
                      section_group_position:
                        type: integer
                        nullable: true
                      name:
                        type: string
                      description:
                        type: string
                      position:
                        type: integer
                        nullable: true
                      drip_delay:
                        type: integer
                      is_published:
                        type: boolean
                      image_cover_url:
                        type: string
                        nullable: true
                  error:
                    type: string
                    nullable: true
              example:
                id: OPERATION_ID
                operation: duplicate_section
                status: completed
                result:
                  id: SECTION_ID
                  product_id: PROGRAM_ID
                  section_group_id: GROUP_ID
                  section_group_position: 1
                  name: Introduction
                  description: Start here
                  position: 1
                  drip_delay: 0
                  is_published: false
                  image_cover_url: null
                error: null
        '202':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  operation:
                    type: string
                  status:
                    type: string
                    enum:
                      - pending
                      - running
                      - completed
                      - failed
                  result:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                      product_id:
                        type: string
                      section_group_id:
                        type: string
                        nullable: true
                      section_group_position:
                        type: integer
                        nullable: true
                      name:
                        type: string
                      description:
                        type: string
                      position:
                        type: integer
                        nullable: true
                      drip_delay:
                        type: integer
                      is_published:
                        type: boolean
                      image_cover_url:
                        type: string
                        nullable: true
                  error:
                    type: string
                    nullable: true
              example:
                id: OPERATION_ID
                operation: duplicate_section
                status: pending
                result: null
                error: null
        '401':
          description: Access denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
              example:
                error: Access denied
        '403':
          description: You do not have permission to perform this action
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
              example:
                error: You do not have permission to perform this action
        '404':
          description: Record not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
              example:
                error: Record not found
        '422':
          description: Invalid arguments
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
              example:
                error: Invalid arguments
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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