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

>  This API allows authenticated clients to initiate a student-specific action plan for a given answer sheet. 

 **How to Use:**

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

 **Validation Details:**

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

 **Example Scenario:**

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



## OpenAPI

````yaml POST /action-plan/v1/k12/student
openapi: 3.0.1
info:
  title: Student Action Plan API
  description: An API for managing student 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/student:
    post:
      tags:
        - Action Plan
      summary: Create Student Action Plan
      description: >-
        Initiates a student action plan for the specified `ans_sheet_id`. The
        client ID is automatically set from the request context.
      operationId: createStudentActionPlan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ans_sheet_id:
                  type: string
                  format: uuid
                  description: Unique identifier of the student's answer sheet.
              required:
                - ans_sheet_id
            example:
              ans_sheet_id: b5a8d8c1-4a34-4e3c-97ab-52972d0bfcf9
      responses:
        '201':
          description: Student 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 answer sheet ID associated with the new student action
                      plan.
                  message:
                    type: string
                    example: Student action plan initiated successfully.
                required:
                  - status_code
                  - response_id
                  - message
              example:
                status_code: 201
                response_id: b5a8d8c1-4a34-4e3c-97ab-52972d0bfcf9
                message: Student action plan initiated successfully.
        '400':
          description: Bad Request – Validation error (e.g., invalid UUID format).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    description: List of validation error details.
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          description: Error type identifier.
                        loc:
                          type: array
                          items:
                            type: string
                          description: Location of the invalid field.
                        msg:
                          type: string
                          description: Human-readable error message.
                        input:
                          type: string
                          description: The input value that failed validation.
                        ctx:
                          type: object
                          description: >-
                            Context object providing extra details about the
                            error.
                          additionalProperties: true
                      required:
                        - type
                        - loc
                        - msg
                required:
                  - detail
              example:
                detail:
                  - type: uuid_parsing
                    loc:
                      - body
                      - ans_sheet_id
                    msg: >-
                      Input should be a valid UUID, invalid group length in
                      group 4: expected 12, found 11
                    input: 654387a0-c412-477a-9126-4ee12d25e4d
                    ctx:
                      error: 'invalid group length in group 4: expected 12, found 11'
        '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

````