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

> 
This API allows authenticated users to create and process lesson plan metadata.

**Duration Constraint:**
- Minimum duration: 30 minutes
- Maximum duration: 90 minutes

**How to Use:**
 1. Call `POST /lesson-plan/metadata` with board, grade, subject, section, duration, topic, and optional file uploads. If no file is provided, the system will search for relevant files from the RAG (Retrieval-Augmented Generation) system.
 2. The API validates IDs, uploads files if present or retrieves them from RAG, stores the lesson plan, and triggers background processing.
 3. On success, you receive a request ID and a message confirming processing has started.

**Example Scenario:**
A teacher wants to create a new lesson plan:
- They submit board, grade, subject, section, duration, topic, and files using this API.
- If no files are uploaded, the system will automatically search for them using RAG.
- The system validates the data, uploads or retrieves files, and starts processing the lesson plan metadata.
- The teacher receives a request ID to track processing status.




## OpenAPI

````yaml POST /lesson-plan/v1/metadata
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/metadata:
    post:
      summary: Create and process lesson plan metadata
      description: >-
        Creates and processes lesson plan metadata. Accepts board, grade,
        subject, section, duration_minutes, topic, and optional file uploads. If
        no file is provided, the system will search for relevant files from the
        RAG (Retrieval-Augmented Generation) system. Validates IDs, uploads
        files if present or retrieves them from RAG, stores the lesson plan, and
        triggers background processing.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                board:
                  type: string
                  format: uuid
                  description: Board ID (UUID)
                grade:
                  type: string
                  format: uuid
                  description: Grade ID (UUID)
                subject:
                  type: string
                  format: uuid
                  description: Subject ID (UUID)
                section:
                  type: string
                  description: Section (optional)
                duration_minutes:
                  type: integer
                  description: Duration in minutes
                topic:
                  type: string
                  description: Topic
                documents:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Optional file uploads
                audio:
                  type: string
                  format: binary
                  description: Optional audio URL **should be mp3 format**
                meta_data:
                  type: string
                  description: JSON string representing the metadata of the worksheet
                  example: '{"teacher_id": 199}'
              required:
                - board
                - grade
                - subject
                - duration_minutes
                - topic
      responses:
        '200':
          description: Lesson plan metadata processing started successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Request ID (UUID)
                        message:
                          type: string
                          description: Success message
              example:
                detail:
                  - id: e2b7c8a2-7c2e-4e8a-9b1e-2c3d4e5f6a7b
                    message: Lesson plan metadata processing started successfully.
        '400':
          description: Validation error (invalid board, grade, or subject ID).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        msg:
                          type: string
              example:
                detail:
                  - msg: >-
                      Board with ID baf36573-d049-4636-9c4b-bc9cda6270fe does
                      not exist.
        '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

````