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

# Create a new GradeElementary

> Create a new GradeElementary



## OpenAPI

````yaml https://spec.speakeasy.com/meitner-2u8/api/directory-api-with-code-samples post /grade-elementary
openapi: 3.1.0
info:
  title: Directory API
  description: Generated API documentation
  contact:
    name: Meitner
    url: https://meitner.se
    email: support@meitner.se
  license:
    name: Proprietary - Licensed to Authorized Customers Only
    url: https://meitner.se
  version: v1
servers:
  - url: https://api.meitner.se/directory/v1
    description: Server to use in production
    x-speakeasy-server-id: production
  - url: https://api.staging.meitner.se/directory/v1
    description: Server to use when building and testing the API
    x-speakeasy-server-id: staging
security:
  - ClientCredentials: []
    ClientSecret: []
  - OAuth2: []
tags:
  - name: School
    description: >
      The `School` resource represents a school where daily operations occur. A
      school must exist before you can create StudentPlacements,
      EmployeePlacements, or Groups.
       
      This resource can be created, updated, listed, retrieved, and searched
      using the standard resource structure.
  - name: Group
    description: Group holds the information about a group of students.
  - name: Employee
    description: >-
      Employee holds the personal information about an employee in the
      organization.
  - name: EmployeePlacement
    description: >-
      EmployeePlacement holds the information about an employee's placement in a
      school.
  - name: Guardian
    description: Guardian holds the information about a guardian of a student.
  - name: Student
    description: >-
      Student holds the personal information about a student, information about
      the school is stored in the StudentPlacement-resource.
  - name: StudentPlacement
    description: >-
      StudentPlacement holds the placement information about a student in a
      specific school.
  - name: AuditEvent
    description: AuditEvent holds the information about an audit event.
  - name: GradeElementary
    description: >
      GradeElementary represents a grade awarded to a student in elementary
      school (Swedish: grundskola).

      Grades are scoped to the organization of the API key used. The SubjectCode
      field uses the subject code as defined by the Swedish school authorities
      (e.g. "MA" for Mathematics).
  - name: GradeUpperSecondary
    description: >
      GradeUpperSecondary represents a grade awarded to a student in upper
      secondary school (Swedish: gymnasieskola).

      Grades are scoped to the organization of the API key used. The CourseCode
      field uses the national course code as defined by the Swedish school
      authorities (e.g. "MATMAT01a").
  - name: Unit
    description: >
      The `Unit` resource represents an organizational unit that schools can
      belong to.

      This resource can be created, updated, listed, retrieved, and searched
      using the standard resource structure.
paths:
  /grade-elementary:
    post:
      tags:
        - GradeElementary
      summary: Create a new GradeElementary
      description: Create a new GradeElementary
      operationId: GradeElementaryCreate
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/GradeElementaryCreate'
      responses:
        '201':
          $ref: '#/components/responses/GradeElementaryCreate'
          description: >-
            Response for GradeElementary Create operation - returns the created
            GradeElementary
        '400':
          $ref: '#/components/responses/Error400ResponseBody'
          description: >-
            Bad Request error for GradeElementary Create operation - request
            contains invalid parameters
        '401':
          $ref: '#/components/responses/Error401ResponseBody'
          description: >-
            Unauthorized error for GradeElementary Create operation -
            authentication required
        '403':
          $ref: '#/components/responses/Error403ResponseBody'
          description: >-
            Forbidden error for GradeElementary Create operation - insufficient
            permissions
        '404':
          $ref: '#/components/responses/Error404ResponseBody'
          description: >-
            Not Found error for GradeElementary Create operation - resource does
            not exist
        '409':
          $ref: '#/components/responses/Error409ResponseBody'
          description: >-
            Conflict error for GradeElementary Create operation - request
            conflicts with current state
        '422':
          $ref: '#/components/responses/GradeElementaryCreate422ResponseBody'
          description: >-
            Validation error for GradeElementary Create operation - request data
            failed validation
        '429':
          $ref: '#/components/responses/Error429ResponseBody'
          description: >-
            Rate Limit error for GradeElementary Create operation - too many
            requests
        '500':
          $ref: '#/components/responses/Error500ResponseBody'
          description: >-
            Internal Server error for GradeElementary Create operation -
            unexpected server error
      x-codeSamples:
        - lang: csharp
          label: Csharp (SDK)
          source: |-
            using Meitner;
            using Meitner.Models.Components;
            using System;

            var sdk = new MeitnerSDK(security: new Security() {
                Option1 = new SecurityOption1() {
                    ClientCredentials = "<YOUR_API_KEY_HERE>",
                    ClientSecret = "<YOUR_API_KEY_HERE>",
                },
            });

            GradeElementaryCreate req = new GradeElementaryCreate() {
                External = new GradeElementaryCreateExternal() {
                    SourceID = "12345678",
                },
                StudentID = "123e4567-e89b-12d3-a456-426614174000",
                SchoolID = "123e4567-e89b-12d3-a456-426614174000",
                SubjectCode = "MA",
                LanguageCode = "SV",
                AcademicYear = "2024/2025",
                Term = GradeElementaryCreateTerm.Ht,
                SchoolYear = GradeElementaryCreateSchoolYear.Nine,
                Teacher1EmployeeID = "123e4567-e89b-12d3-a456-426614174000",
                Teacher2EmployeeID = "123e4567-e89b-12d3-a456-426614174000",
                Grade = GradeElementaryCreateGrade.A,
                GradeDate = DateOnly.Parse("2025-01-15"),
                FinalGrade = true,
                IsEnded = true,
                SchoolComment = "Utmärkt arbete under hela terminen.",
            };

            var res = await sdk.GradeElementaries.CreateAsync(req);

            // handle response
        - lang: python
          label: Python (SDK)
          source: |-
            from datetime import date
            from meitner import Meitner, models
            import os


            with Meitner(
                security=models.Security(
                    option1=models.SecurityOption1(
                        client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
                        client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
                    ),
                ),
            ) as m_client:

                res = m_client.grade_elementaries.create(student_id="123e4567-e89b-12d3-a456-426614174000", school_id="123e4567-e89b-12d3-a456-426614174000", subject_code="MA", academic_year="2024/2025", term="HT", school_year="9", final_grade=True, is_ended=True, external={
                    "source_id": "12345678",
                }, language_code="SV", teacher1_employee_id="123e4567-e89b-12d3-a456-426614174000", teacher2_employee_id="123e4567-e89b-12d3-a456-426614174000", grade="A", grade_date=date.fromisoformat("2025-01-15"), school_comment="Utmärkt arbete under hela terminen.")

                # Handle response
                print(res)
components:
  requestBodies:
    GradeElementaryCreate:
      description: Request body
      content:
        application/json:
          schema:
            type: object
            properties:
              external:
                allOf:
                  - $ref: '#/components/schemas/ExternalRequest'
                examples:
                  - sourceID: '12345678'
                description: >-
                  ExternalRequest is the External-object used on Create and
                  Update operations. Only SourceID can be set — the Source field
                  is derived from the API key.
              studentID:
                type: string
                examples:
                  - 123e4567-e89b-12d3-a456-426614174000
                format: uuid
                description: >-
                  The ID of the student the grade belongs to. Must reference a
                  student within the organization who has an active placement at
                  the school referenced by SchoolID.
              schoolID:
                type: string
                examples:
                  - 123e4567-e89b-12d3-a456-426614174000
                format: uuid
                description: >-
                  The ID of the school where the student received the grade.
                  Must reference a school within the organization.
              subjectCode:
                type: string
                examples:
                  - MA
                description: >-
                  The subject code as defined by the Swedish school authorities
                  (e.g. "MA" for Mathematics, "SV" for Swedish).
              languageCode:
                type: string
                examples:
                  - SV
                  - null
                description: >-
                  The language code for the grade, used when the subject is
                  taught in a specific language (e.g. mother tongue
                  instruction).
                nullable: true
              academicYear:
                type: string
                examples:
                  - 2024/2025
                description: >-
                  The academic year in which the grade was awarded, in the
                  format YYYY/YYYY (e.g. "2024/2025").
              term:
                allOf:
                  - $ref: '#/components/schemas/GradeTerm'
                examples:
                  - HT
                description: The school term in which the grade was awarded.
              schoolYear:
                allOf:
                  - $ref: '#/components/schemas/GradeElementarySchoolYear'
                examples:
                  - '9'
                description: >-
                  The school year of the student at the time the grade was
                  awarded.
              teacher1EmployeeID:
                type: string
                examples:
                  - 123e4567-e89b-12d3-a456-426614174000
                  - null
                format: uuid
                description: >-
                  The ID of the primary teacher responsible for the grade. Must
                  reference an Employee who has an active placement at the
                  school referenced by SchoolID.
                nullable: true
              teacher2EmployeeID:
                type: string
                examples:
                  - 123e4567-e89b-12d3-a456-426614174000
                  - null
                format: uuid
                description: >-
                  The ID of the secondary teacher responsible for the grade.
                  Must reference an Employee who has an active placement at the
                  school referenced by SchoolID.
                nullable: true
              grade:
                allOf:
                  - $ref: '#/components/schemas/Grade'
                examples:
                  - A
                  - null
                description: The grade awarded to the student.
                nullable: true
              gradeDate:
                type: string
                examples:
                  - '2025-01-15'
                  - null
                format: date
                description: The date the grade was awarded.
                nullable: true
              finalGrade:
                type: boolean
                examples:
                  - true
                description: >-
                  Whether this is the final grade for the student in this
                  subject. A final grade is the official grade used on the
                  student's grade certificate.
              isEnded:
                type: boolean
                examples:
                  - true
                description: >-
                  Whether the grading period has ended for this student in this
                  subject.
              schoolComment:
                type: string
                examples:
                  - Utmärkt arbete under hela terminen.
                  - null
                description: >-
                  A comment from the school about the grade, visible to the
                  student and guardians.
                nullable: true
            required:
              - studentID
              - schoolID
              - subjectCode
              - academicYear
              - term
              - schoolYear
              - finalGrade
              - isEnded
          examples:
            requestExample:
              summary: Request body example
              value:
                external:
                  sourceID: '12345678'
                studentID: 123e4567-e89b-12d3-a456-426614174000
                schoolID: 123e4567-e89b-12d3-a456-426614174000
                subjectCode: MA
                languageCode: SV
                academicYear: 2024/2025
                term: HT
                schoolYear: '9'
                teacher1EmployeeID: 123e4567-e89b-12d3-a456-426614174000
                teacher2EmployeeID: 123e4567-e89b-12d3-a456-426614174000
                grade: A
                gradeDate: '2025-01-15'
                finalGrade: true
                isEnded: true
                schoolComment: Utmärkt arbete under hela terminen.
      required: true
  responses:
    GradeElementaryCreate:
      description: >-
        Response for GradeElementary Create operation - returns the created
        GradeElementary
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/GradeElementary'
          examples:
            responseExample:
              summary: Response body example
              value:
                id: 123e4567-e89b-12d3-a456-426614174000
                meta:
                  createdAt: '2024-01-15T10:30:00Z'
                  createdBy: 987fcdeb-51a2-43d1-b567-123456789abc
                  updatedAt: '2024-01-15T14:45:00Z'
                  updatedBy: 987fcdeb-51a2-43d1-b567-123456789abc
                external:
                  sourceID: '12345678'
                  source: ExternalIntegrationAPI
                studentID: 123e4567-e89b-12d3-a456-426614174000
                schoolID: 123e4567-e89b-12d3-a456-426614174000
                subjectCode: MA
                languageCode: SV
                academicYear: 2024/2025
                term: HT
                schoolYear: '9'
                teacher1EmployeeID: 123e4567-e89b-12d3-a456-426614174000
                teacher2EmployeeID: 123e4567-e89b-12d3-a456-426614174000
                grade: A
                gradeDate: '2025-01-15'
                finalGrade: true
                isEnded: true
                schoolComment: Utmärkt arbete under hela terminen.
    Error400ResponseBody:
      description: Bad Request - The request was malformed or contained invalid parameters
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Bad Request error example
              value:
                error:
                  code: BadRequest
                  message: The request contains invalid parameters or malformed data
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    Error401ResponseBody:
      description: Unauthorized - The request is missing valid authentication credentials
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Unauthorized error example
              value:
                error:
                  code: Unauthorized
                  message: Authentication credentials are missing or invalid
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    Error403ResponseBody:
      description: >-
        Forbidden - Request is authenticated, but the user is not allowed to
        perform the operation
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Forbidden error example
              value:
                error:
                  code: Forbidden
                  message: You do not have permission to perform this operation
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    Error404ResponseBody:
      description: Not Found - The requested resource does not exist
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Not Found error example
              value:
                error:
                  code: NotFound
                  message: The requested resource could not be found
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    Error409ResponseBody:
      description: Conflict - The request could not be completed due to a conflict
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Conflict error example
              value:
                error:
                  code: Conflict
                  message: The request conflicts with the current state of the resource
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    GradeElementaryCreate422ResponseBody:
      description: >-
        Validation error for GradeElementary Create operation - request data
        failed validation
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: UnprocessableEntity
                    message: Validation failed for GradeElementary Create endpoint
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            validationError:
              summary: Validation error example
              value:
                error:
                  code: UnprocessableEntity
                  message: Validation failed for GradeElementary Create endpoint
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    Error429ResponseBody:
      description: Too Many Requests - When the rate limit has been exceeded
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Rate Limited error example
              value:
                error:
                  code: RateLimited
                  message: Too many requests - rate limit exceeded
                  requestID: 550e8400-e29b-41d4-a716-446655440000
    Error500ResponseBody:
      description: Internal Server Error - An unexpected server error occurred
      headers:
        RateLimit-Limit:
          description: >-
            The maximum number of API requests you're permitted to make per
            hour.
          schema:
            type: integer
            examples:
              - 5000
        RateLimit-Remaining:
          description: >-
            The number of API requests remaining in the current rate limit
            window.
          schema:
            type: integer
            examples:
              - 4999
        RateLimit-Reset:
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            milliseconds.
          schema:
            type: string
            examples:
              - '1728316800000'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                examples:
                  - code: BadRequest
                    message: The request contains invalid parameters or malformed data
                    requestID: 550e8400-e29b-41d4-a716-446655440000
            required:
              - error
          examples:
            errorExample:
              summary: Internal Server error example
              value:
                error:
                  code: Internal
                  message: An unexpected server error occurred
                  requestID: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    ExternalRequest:
      type: object
      properties:
        sourceID:
          type: string
          examples:
            - '12345678'
          description: The ID of the external source
      required:
        - sourceID
      description: >-
        ExternalRequest is the External-object used on Update and Create
        operations, since it should only be allowed to set SourceID, the
        Source-field is not included.
    GradeTerm:
      type: string
      enum:
        - HT
        - VT
      description: The school term in which the grade was awarded
    GradeElementarySchoolYear:
      type: string
      enum:
        - '6'
        - '7'
        - '8'
        - '9'
      description: >-
        The school year of the student when the grade was awarded (elementary
        school)
    Grade:
      type: string
      enum:
        - A
        - B
        - C
        - D
        - E
        - F
        - MISSING
      description: The grade awarded to a student
    GradeElementary:
      type: object
      properties:
        id:
          type: string
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          description: Unique identifier for the GradeElementary
        meta:
          allOf:
            - $ref: '#/components/schemas/Meta'
          examples:
            - createdAt: '2024-01-15T10:30:00Z'
              createdBy: 987fcdeb-51a2-43d1-b567-123456789abc
              updatedAt: '2024-01-15T14:45:00Z'
              updatedBy: 987fcdeb-51a2-43d1-b567-123456789abc
          description: Metadata information for the GradeElementary
        external:
          allOf:
            - $ref: '#/components/schemas/External'
          examples:
            - sourceID: '12345678'
              source: ExternalIntegrationAPI
            - null
          description: >-
            External is a reusable object that can be used to store external
            information about the grade from another system, used for
            third-party integration tracking.
          nullable: true
        studentID:
          type: string
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          description: >-
            The ID of the student the grade belongs to. Must reference a student
            within the organization who has an active placement at the school
            referenced by SchoolID.
        schoolID:
          type: string
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          description: >-
            The ID of the school where the student received the grade. Must
            reference a school within the organization.
        subjectCode:
          type: string
          examples:
            - MA
          description: >-
            The subject code as defined by the Swedish school authorities (e.g.
            "MA" for Mathematics, "SV" for Swedish).
        languageCode:
          type: string
          examples:
            - SV
            - null
          description: >-
            The language code for the grade, used when the subject is taught in
            a specific language (e.g. mother tongue instruction).
          nullable: true
        academicYear:
          type: string
          examples:
            - 2024/2025
          description: >-
            The academic year in which the grade was awarded, in the format
            YYYY/YYYY (e.g. "2024/2025").
        term:
          allOf:
            - $ref: '#/components/schemas/GradeTerm'
          examples:
            - HT
          description: The school term in which the grade was awarded.
        schoolYear:
          allOf:
            - $ref: '#/components/schemas/GradeElementarySchoolYear'
          examples:
            - '9'
          description: The school year of the student at the time the grade was awarded.
        teacher1EmployeeID:
          type: string
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
            - null
          format: uuid
          description: >-
            The ID of the primary teacher responsible for the grade. Must
            reference an Employee who has an active placement at the school
            referenced by SchoolID.
          nullable: true
        teacher2EmployeeID:
          type: string
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
            - null
          format: uuid
          description: >-
            The ID of the secondary teacher responsible for the grade. Must
            reference an Employee who has an active placement at the school
            referenced by SchoolID.
          nullable: true
        grade:
          allOf:
            - $ref: '#/components/schemas/Grade'
          examples:
            - A
            - null
          description: The grade awarded to the student.
          nullable: true
        gradeDate:
          type: string
          examples:
            - '2025-01-15'
            - null
          format: date
          description: The date the grade was awarded.
          nullable: true
        finalGrade:
          type: boolean
          examples:
            - true
          description: >-
            Whether this is the final grade for the student in this subject. A
            final grade is the official grade used on the student's grade
            certificate.
        isEnded:
          type: boolean
          examples:
            - true
          description: >-
            Whether the grading period has ended for this student in this
            subject.
        schoolComment:
          type: string
          examples:
            - Utmärkt arbete under hela terminen.
            - null
          description: >-
            A comment from the school about the grade, visible to the student
            and guardians.
          nullable: true
      required:
        - id
        - studentID
        - schoolID
        - subjectCode
        - academicYear
        - term
        - schoolYear
        - finalGrade
        - isEnded
      description: >
        GradeElementary represents a grade awarded to a student in elementary
        school (Swedish: grundskola).

        Grades are scoped to the organization of the API key used. The
        SubjectCode field uses the subject code as defined by the Swedish school
        authorities (e.g. "MA" for Mathematics).
    Error:
      type: object
      properties:
        code:
          allOf:
            - $ref: '#/components/schemas/ErrorCode'
          description: The specific error code indicating the type of error
        message:
          type: string
          examples:
            - example
          description: Human-readable error message providing additional details
        requestID:
          type: string
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          description: >-
            Unique identifier for the request that generated this error, used
            for logging and debugging
      required:
        - code
        - message
        - requestID
      description: >-
        Standard error response object containing error code, message, and
        request ID
    Meta:
      type: object
      properties:
        createdAt:
          type: string
          examples:
            - '2024-01-15T10:30:00Z'
          format: date-time
          description: Timestamp when the resource was created
        createdBy:
          type: string
          examples:
            - 987fcdeb-51a2-43d1-b567-123456789abc
            - null
          format: uuid
          description: User who created the resource
          nullable: true
        updatedAt:
          type: string
          examples:
            - '2024-01-15T14:45:00Z'
            - null
          format: date-time
          description: Timestamp when the resource was last updated
          nullable: true
        updatedBy:
          type: string
          examples:
            - 987fcdeb-51a2-43d1-b567-123456789abc
            - null
          format: uuid
          description: User who last updated the resource
          nullable: true
      required:
        - createdAt
      description: >-
        Meta contains information about the creation and modification of a
        resource for auditing purposes
    External:
      type: object
      properties:
        sourceID:
          type: string
          examples:
            - '12345678'
            - null
          description: The ID of the external source
          nullable: true
        source:
          type: string
          examples:
            - ExternalIntegrationAPI
            - null
          description: The source of the external information
          nullable: true
      description: >-
        External is a reusable object that can be used to store external
        information from another system, used for third-party integration
        tracking.
    ErrorCode:
      type: string
      enum:
        - BadRequest
        - Unauthorized
        - Forbidden
        - NotFound
        - Conflict
        - UnprocessableEntity
        - RateLimited
        - Internal
      description: Standard error codes used in API responses
  securitySchemes:
    ClientCredentials:
      type: apiKey
      name: Client-ID
      in: header
    ClientSecret:
      type: apiKey
      name: Client-Secret
      in: header
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes: {}

````