> ## 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 - Teacher Action Plan

>  This API allows authenticated clients to initiate a teacher-specific action plan for a given exam. 

 **How to Use:**

 1. Call `POST /action-plan/v1/k12/teacher` with a JSON body containing a valid `exam_id` (UUID).
 2. If validation succeeds, the system prepares and stores the teacher action plan data.
 3. A `201 Created` response is returned with a confirmation message and the related `exam_id`. 

 **Validation Details:**

 - The `exam_id` must be a valid UUID and correspond to an existing exam record.
 - If the exam does not exist or validation fails, a `400 Bad Request` response is returned with error details.
 - Any unexpected errors result in a `500 Internal Server Error`. 

 **Example Scenario:**

 A school admin wants to create a teacher action plan for a specific exam:
 - They send a POST request with the required `exam_id`.
 - The API validates the exam and associates it with the authenticated client's ID.
 - If valid, the system prepares and stores the plan.
 - The admin receives a success message confirming that the teacher action plan has been initiated. 



## OpenAPI

````yaml POST /action-plan/v1/k12/teacher
openapi: 3.0.1
info:
  title: Teacher Action Plan API
  description: An API for managing teacher action plans.
  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:
  /action-plan/v1/k12/teacher:
    post:
      tags:
        - Action Plan
      summary: Create Teacher Action Plan
      description: >-
        Initiates a teacher action plan for the specified exam ID. The client ID
        is set internally from the request context.
      operationId: createTeacherActionPlan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                exam_id:
                  type: string
                  format: uuid
                  description: >-
                    Unique identifier of the exam for which the teacher action
                    plan will be created.
              required:
                - exam_id
            example:
              exam_id: d7c8333e-9a2d-4c6d-8bb8-4a02ad6e43fd
      responses:
        '201':
          description: Teacher action plan successfully initiated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status_code:
                    type: integer
                    example: 201
                  response_id:
                    type: string
                    format: uuid
                    description: >-
                      The exam ID that was used to create the teacher action
                      plan.
                  message:
                    type: string
                    example: Teacher action plan initiated successfully.
                required:
                  - status_code
                  - response_id
                  - message
              example:
                status_code: 201
                response_id: d7c8333e-9a2d-4c6d-8bb8-4ass02ad6e43fd
                message: Teacher action plan initiated successfully.
        '400':
          description: Bad Request - Invalid or non-existent exam ID.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: object
                    properties:
                      loc:
                        type: string
                        example: body.exam_id
                      msg:
                        type: string
                        example: >-
                          Value error, Exam with ID
                          fafa2338-97d8-4e16-af86-5c71af83522a does not exist
                      input:
                        type: string
                        example: invalid-uuid
                      ctx:
                        type: object
                        example: {}
                required:
                  - detail
              example:
                detail:
                  - type: value_error
                    loc:
                      - body
                    msg: >-
                      Value error, Exam with ID
                      fafa2338-97d8-4e16-af86-5c71af83522a does not exist
                    input:
                      exam_id: fafa2338-97d8-4e16-af86-5c71af83522a
                    ctx:
                      error: {}
        '500':
          description: Internal Server Error - Unexpected server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Internal Server Error
                required:
                  - detail
              example:
                detail: Internal Server Error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````