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

>  This API allows authenticated users to **create a new assignment** by providing essential details like assignment name, institute info, and class metadata. 

 **Key Notes:** 
 - `assignmentName` (required): The title of the assignment. 
 - `parentInstituteId`, `instituteId`, `courseId`: Help link the assignment to the correct organizational hierarchy. 
 - `grade` and `section`: Specify the targeted academic group for the assignment. 

 **Scenario: Creating an Assignment for Grade 8 - Section B**   
 - A teacher wants to assign a new English essay task to Grade 8 students of Section B.   
 - They send a POST request with all necessary metadata.   
 - Upon success, the assignment is created and returns an ID, ready for document uploads and evaluation. 



## OpenAPI

````yaml POST /assignment-evaluation/v1/assignment/
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:
  /assignment-evaluation/v1/assignment/:
    post:
      tags:
        - Assignments
      summary: Create Assignment
      operationId: createAssignment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                assignmentName:
                  type: string
                  example: English Assignment
                  description: Name of the assignment
                parentInstituteId:
                  type: string
                  example: '101'
                  description: ID of the parent institute
                instituteId:
                  type: string
                  example: '202'
                  description: ID of the institute
                courseId:
                  type: string
                  example: '303'
                  description: ID of the course
                grade:
                  type: string
                  example: '8'
                  description: Grade of the assignment
                section:
                  type: string
                  example: B
                  description: Section of the assignment
              required:
                - assignmentName
      responses:
        '201':
          description: Assignment created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 2600413f-7c6e-46ef-8ea9-3e7b5834879f
                    description: Unique identifier for the assignment
                  documents:
                    type: array
                    example: []
        '400':
          description: Bad Request - Invalid input or missing required fields
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                      message:
                        type: object
                        properties:
                          assignmentName:
                            type: array
                            items:
                              type: string
                              example: This field is required.
        '403':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403Response'
      security:
        - bearerAuth: []
components:
  schemas:
    403Response:
      type: object
      properties:
        detail:
          type: string
          example: Token has expired
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````