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

# Add Defect

> Add a defect to an inspection.



## OpenAPI

````yaml /api/openapi-cutmake.json post /api/v1/qc/{inspection_id}/defects
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/qc/{inspection_id}/defects:
    post:
      tags:
        - Quality Control
      summary: Add Defect
      description: Add a defect to an inspection.
      operationId: add_defect_api_v1_qc__inspection_id__defects_post
      parameters:
        - name: inspection_id
          in: path
          required: true
          schema:
            type: string
            title: Inspection Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QCDefectPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QCDefectResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    QCDefectPayload:
      properties:
        defectType:
          type: string
          title: Defecttype
        defectDescription:
          type: string
          title: Defectdescription
        severity:
          type: string
          title: Severity
        quantity:
          type: integer
          title: Quantity
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
        imageUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Imageurl
      type: object
      required:
        - defectType
        - defectDescription
        - severity
        - quantity
      title: QCDefectPayload
    QCDefectResponse:
      properties:
        id:
          type: string
          title: Id
        defectType:
          type: string
          title: Defecttype
        defectDescription:
          type: string
          title: Defectdescription
        severity:
          type: string
          title: Severity
        quantity:
          type: integer
          title: Quantity
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
        imageUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Imageurl
        createdAt:
          type: string
          title: Createdat
      type: object
      required:
        - id
        - defectType
        - defectDescription
        - severity
        - quantity
        - createdAt
      title: QCDefectResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````