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

# POST - Lesson Plan Finalize Metadata

> 
This API allows authenticated users to trigger the finalization metadata process for a lesson plan.

**How to Use:**
 1. Call this endpoint with the finalized metadata payload, including subject matter and learning standards.
 2. The API validates the lesson plan ID, checks metadata step status, and ensures alignment is not already in progress or completed.
 3. On success, the system updates metadata, triggers the alignment process asynchronously, and returns a success message.

**Example Scenario:**
A teacher submits finalized metadata for a lesson plan.
- The system validates the request and workflow state.
- If valid, metadata is saved and alignment starts.
- The teacher receives confirmation that alignment has been initiated.




## OpenAPI

````yaml POST /lesson-plan/v1/finalize-metadata/{lesson_plan_id}
openapi: 3.0.1
info:
  title: Evaluation Report API
  description: An API for retrieving evaluation reports.
  version: 1.0.0
servers:
  - url: https://api-staging.crazygoldfish.com
    description: SandBox endpoint
  - url: https://api.crazygoldfish.com
    description: Prod End Point
security: []
paths:
  /lesson-plan/v1/finalize-metadata/{lesson_plan_id}:
    post:
      summary: Trigger Lesson Plan Alignment
      description: >-
        Initiates the alignment process for a lesson plan by providing
        **finalized metadata**. The request body now includes AI-generated and
        additional recommendations for subject matter and learning standards,
        enabling richer context for automated alignment.
      parameters:
        - name: lesson_plan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: 4340132f-50fa-4877-9ffa-e9b7ee59d51f
          description: Unique identifier of the lesson plan to align.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subject_matter:
                  type: object
                  description: >-
                    Finalized subject matter details, including AI and
                    additional recommendations.
                  properties:
                    topics_to_be_covered:
                      type: object
                      description: Topics with AI and additional teaching recommendations.
                      properties:
                        topic:
                          type: object
                          properties:
                            ai_recommendations:
                              type: array
                              items:
                                type: string
                              description: >-
                                AI-generated suggestions for topics to be
                                covered.
                            additional_recommendations:
                              type: array
                              items:
                                type: string
                              description: >-
                                Human-curated or extra suggestions for covering
                                topics.
                    key_concepts_and_subconcepts:
                      type: object
                      description: >-
                        Key concepts and subconcepts with AI and additional
                        recommendations.
                      properties:
                        concepts:
                          type: object
                          properties:
                            ai_recommendations:
                              type: array
                              items:
                                type: string
                              description: AI-generated conceptual recommendations.
                            additional_recommendations:
                              type: array
                              items:
                                type: string
                              description: >-
                                Extra recommendations for concepts and
                                subconcepts.
                    prerequisite_knowledge:
                      type: object
                      description: >-
                        Prerequisite knowledge with AI and additional
                        recommendations.
                      properties:
                        prerequisite:
                          type: object
                          properties:
                            ai_recommendations:
                              type: array
                              items:
                                type: string
                              description: >-
                                AI suggestions for prerequisite skills and
                                knowledge.
                            additional_recommendations:
                              type: array
                              items:
                                type: string
                              description: Extra guidance for prerequisite preparation.
                learning_standards:
                  type: object
                  description: >-
                    Expected learning outcomes, objectives, and competencies
                    with AI and additional recommendations.
                  properties:
                    learning_outcomes:
                      type: object
                      properties:
                        outcomes:
                          type: object
                          properties:
                            ai_recommendations:
                              type: array
                              items:
                                type: string
                              description: AI-recommended learning outcomes.
                            additional_recommendations:
                              type: array
                              items:
                                type: string
                              description: Extra suggested learning outcomes.
                    smart_learning_objectives:
                      type: object
                      properties:
                        objects:
                          type: object
                          properties:
                            ai_recommendations:
                              type: array
                              items:
                                type: string
                              description: AI-generated SMART learning objectives.
                            additional_recommendations:
                              type: array
                              items:
                                type: string
                              description: Additional SMART objectives.
                    competencies:
                      type: object
                      description: List of competencies to be achieved.
                      properties:
                        competency_list:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                description: Unique code or title of the competency.
                              description:
                                type: string
                                description: Detailed explanation of the competency.
              required:
                - subject_matter
                - learning_standards
            example:
              subject_matter:
                topics_to_be_covered:
                  topic:
                    ai_recommendations:
                      - >-
                        Community Roles and Responsibilities: Understanding the
                        various roles people play in families, schools, and
                        neighborhoods, such as teachers, students, caretakers,
                        and volunteers.
                      - >-
                        Cooperation and Teamwork in Communities: Exploring how
                        people work together during festivals, celebrations, and
                        times of need to build strong community bonds.
                      - >-
                        Caring for the Environment and Neighborhood: Learning
                        ways to take care of nature, manage waste responsibly,
                        and improve soil quality through practices like
                        composting.
                      - >-
                        Community Institutions and Their Functions: Examining
                        the importance of local institutions such as schools,
                        hospitals, banks, and markets in daily community life.
                      - >-
                        Celebrations and Shared Traditions: Discussing how
                        communal events and festivals promote social interaction
                        and a sense of belonging among community members.
                    additional_recommendations:
                      - >-
                        Incorporate storytelling and role-play activities to
                        help students understand community roles and
                        cooperation.
                      - >-
                        Include practical activities such as community clean-up
                        drives or planting trees to connect learning with
                        real-life environmental care.
                key_concepts_and_subconcepts:
                  concepts:
                    ai_recommendations:
                      - >-
                        Community Roles and Responsibilities: teachers,
                        students, caretakers, and volunteers
                      - >-
                        Cooperation and Teamwork in Communities: working
                        together during festivals, celebrations, and times of
                        need
                      - >-
                        Caring for the Environment and Neighborhood: managing
                        waste responsibly and improving soil quality through
                        composting
                      - >-
                        Community Institutions and Their Functions: schools,
                        hospitals, banks, and markets
                      - >-
                        Celebrations and Shared Traditions: communal events and
                        festivals promote social interaction and a sense of
                        belonging
                    additional_recommendations:
                      - >-
                        Community Roles and Responsibilities: bus drivers' role
                        in schools
                      - >-
                        Cooperation and Teamwork in Communities: supporting each
                        other in times of need
                      - >-
                        Caring for the Environment and Neighborhood: leaves
                        buried in a pit become manure and improve soil quality
                      - >-
                        Community Institutions and Their Functions: importance
                        of community institutes in daily life
                      - >-
                        Celebrations and Shared Traditions: eating together
                        during community feasts
                prerequisite_knowledge:
                  prerequisite:
                    ai_recommendations:
                      - >-
                        Basic understanding of family and school members and
                        their roles.
                      - >-
                        Familiarity with simple cooperation and teamwork
                        activities in school settings.
                      - >-
                        Knowledge of common festivals and celebrations in
                        community contexts.
                      - >-
                        Awareness of environmental care such as waste disposal
                        and planting.
                      - >-
                        Recognition of community helpers and local institutions
                        like schools and hospitals.
                    additional_recommendations:
                      - >-
                        Use stories about family and school to illustrate roles
                        and responsibilities.
                      - >-
                        Engage students in simple group activities emphasizing
                        cooperation.
                      - >-
                        Include exercises identifying festivals and community
                        events.
                      - >-
                        Introduce basic environmental care practices through
                        hands-on tasks.
                      - >-
                        Discuss the functions of familiar community institutions
                        in daily life.
              learning_standards:
                learning_outcomes:
                  outcomes:
                    ai_recommendations:
                      - >-
                        Community Roles and Responsibilities: Understanding the
                        various roles people play in families, schools, and
                        neighborhoods, such as teachers, students, caretakers,
                        and volunteers.
                      - >-
                        Cooperation and Teamwork in Communities: Exploring how
                        people work together during festivals, celebrations, and
                        times of need to build strong community bonds.
                      - >-
                        Caring for the Environment and Neighborhood: Learning
                        ways to take care of nature, manage waste responsibly,
                        and improve soil quality through practices like
                        composting.
                      - >-
                        Community Institutions and Their Functions: Examining
                        the importance of local institutions such as schools,
                        hospitals, banks, and markets in daily community life.
                      - >-
                        Celebrations and Shared Traditions: Discussing how
                        communal events and festivals promote social interaction
                        and a sense of belonging among community members.
                    additional_recommendations:
                      - >-
                        Incorporate storytelling and role-play activities to
                        help students understand community roles and
                        cooperation.
                      - >-
                        Include practical activities such as community clean-up
                        drives or planting trees to connect learning with
                        real-life environmental care.
                smart_learning_objectives:
                  objects:
                    ai_recommendations:
                      - >-
                        Students will identify and describe at least four
                        different community roles (e.g., teacher, student,
                        caretaker, volunteer) within families, schools, or
                        neighborhoods within 15 minutes. (Remembering)
                      - >-
                        Students will explain the importance of cooperation and
                        teamwork during community festivals and celebrations by
                        participating in a role-play activity within 20 minutes.
                        (Understanding)
                      - >-
                        Students will demonstrate responsible environmental care
                        by participating in a group composting or waste
                        management activity and explaining its benefits within
                        25 minutes. (Applying)
                      - >-
                        Students will list and describe the functions of at
                        least three local community institutions such as
                        schools, hospitals, and markets within 15 minutes.
                        (Remembering)
                      - >-
                        Students will discuss how communal celebrations and
                        shared traditions promote social interaction and a sense
                        of belonging through a storytelling session within 20
                        minutes. (Understanding)
                    additional_recommendations:
                      - >-
                        Use storytelling and role-play activities to help
                        students internalize community roles and cooperation
                        concepts.
                      - >-
                        Organize practical environmental activities like
                        clean-up drives or tree planting to connect lessons with
                        real-life experiences.
                competencies:
                  competency_list:
                    - name: Community Roles and Responsibilities (C-8.1)
                      description: >-
                        Understanding the various roles people play in families,
                        schools, and neighborhoods, including teachers,
                        students, caretakers, and volunteers.
                    - name: Cooperation and Teamwork in Communities (C-8.2)
                      description: >-
                        Exploring how individuals work together during
                        festivals, celebrations, and times of need to build
                        strong community bonds.
                    - name: Environmental Care and Waste Management (C-8.3)
                      description: >-
                        Learning methods to care for the environment, manage
                        waste responsibly, and improve soil quality through
                        practices like composting.
                    - name: Community Institutions and Their Functions (C-8.4)
                      description: >-
                        Examining the importance of local institutions such as
                        schools, hospitals, banks, and markets in everyday
                        community life.
                    - name: Celebrations and Shared Traditions (C-8.5)
                      description: >-
                        Discussing how communal events and festivals promote
                        social interaction and foster a sense of belonging among
                        community members.
      responses:
        '200':
          description: Lesson plan alignment initiated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Lesson plan ID.
                        message:
                          type: string
                          description: Success message.
              example:
                detail:
                  - id: 123e4567-e89b-12d3-a456-426614174000
                    message: Lesson plan alignment initiated successfully.
        '400':
          description: Validation error or invalid request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        msg:
                          type: string
              example:
                detail:
                  - msg: Lesson plan metadata is not finalized!
        '404':
          description: Lesson plan not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        msg:
                          type: string
              example:
                detail:
                  - msg: Lesson plan not found.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        msg:
                          type: string
              example:
                detail:
                  - msg: Unexpected error occurred.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````