Skip to main content
POST
/
grade-upper-secondary
Python (SDK)
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_upper_secondaries.create(student_id="123e4567-e89b-12d3-a456-426614174000", school_id="123e4567-e89b-12d3-a456-426614174000", course_code="MATMAT01a", include_on_final_grade=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"), grade_comment="Eleven har visat goda kunskaper i algebra.", extent="Normal", school_year="2", section="Program", teacher_comment="Eleven deltar aktivt och visar stort engagemang.", program_title="Teknikprogrammet", start_date=date.fromisoformat("2024-08-19"), end_date=date.fromisoformat("2025-01-17"))

    # Handle response
    print(res)
{
  "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",
  "courseCode": "MATMAT01a",
  "languageCode": "SV",
  "teacher1EmployeeID": "123e4567-e89b-12d3-a456-426614174000",
  "teacher2EmployeeID": "123e4567-e89b-12d3-a456-426614174000",
  "grade": "A",
  "gradeDate": "2025-01-15",
  "gradeComment": "Eleven har visat goda kunskaper i algebra.",
  "extent": "Normal",
  "schoolYear": "2",
  "section": "Program",
  "teacherComment": "Eleven deltar aktivt och visar stort engagemang.",
  "includeOnFinalGrade": true,
  "programTitle": "Teknikprogrammet",
  "startDate": "2024-08-19",
  "endDate": "2025-01-17"
}

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.

Authorizations

Client-ID
string
header
required
Client-Secret
string
header
required

Body

application/json

Request body

studentID
string<uuid>
required

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.

Example:

"123e4567-e89b-12d3-a456-426614174000"

schoolID
string<uuid>
required

The ID of the school where the student received the grade. Must reference a school within the organization.

Example:

"123e4567-e89b-12d3-a456-426614174000"

courseCode
string
required

The national course code as defined by the Swedish school authorities (e.g. "MATMAT01a" for Mathematics 1a).

Example:

"MATMAT01a"

includeOnFinalGrade
boolean
required

Whether this course grade should be included when calculating the student's final grade certificate.

Example:

true

external
object

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.

Example:
{ "sourceID": "12345678" }
languageCode
string | null

The language code for the grade, used when the course is taught in a specific language.

Examples:

"SV"

null

teacher1EmployeeID
string<uuid> | null

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.

Examples:

"123e4567-e89b-12d3-a456-426614174000"

null

teacher2EmployeeID
string<uuid> | null

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.

Examples:

"123e4567-e89b-12d3-a456-426614174000"

null

grade
enum<string>

The grade awarded to the student.

Available options:
A,
B,
C,
D,
E,
F,
MISSING
Example:

"A"

gradeDate
string<date> | null

The date the grade was awarded.

Examples:

"2025-01-15"

null

gradeComment
string | null

A comment about the grade from the teacher.

Examples:

"Eleven har visat goda kunskaper i algebra."

null

extent
enum<string>

The extent of the course for this student.

Available options:
Normal,
Extended,
Reduced
Example:

"Normal"

schoolYear
enum<string>

The school year of the student at the time the grade was awarded.

Available options:
1,
2,
3
Example:

"2"

section
enum<string>

The section/type of the course in the student's study plan.

Available options:
General,
Program,
Orientation,
Specialization,
Individual,
Project,
Elementary
Example:

"Program"

teacherComment
string | null

A comment from the teacher about the student's performance.

Examples:

"Eleven deltar aktivt och visar stort engagemang."

null

programTitle
string | null

The title of the program this course belongs to. Used to associate the course with a specific educational program.

Examples:

"Teknikprogrammet"

null

startDate
string<date> | null

The date the student started the course.

Examples:

"2024-08-19"

null

endDate
string<date> | null

The date the student finished the course.

Examples:

"2025-01-17"

null

Response

Response for GradeUpperSecondary Create operation - returns the created GradeUpperSecondary

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").

id
string<uuid>
required

Unique identifier for the GradeUpperSecondary

Example:

"123e4567-e89b-12d3-a456-426614174000"

studentID
string<uuid>
required

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.

Example:

"123e4567-e89b-12d3-a456-426614174000"

schoolID
string<uuid>
required

The ID of the school where the student received the grade. Must reference a school within the organization.

Example:

"123e4567-e89b-12d3-a456-426614174000"

courseCode
string
required

The national course code as defined by the Swedish school authorities (e.g. "MATMAT01a" for Mathematics 1a).

Example:

"MATMAT01a"

includeOnFinalGrade
boolean
required

Whether this course grade should be included when calculating the student's final grade certificate.

Example:

true

meta
object

Metadata information for the GradeUpperSecondary

Example:
{
  "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
object

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.

Example:
{
  "sourceID": "12345678",
  "source": "ExternalIntegrationAPI"
}
languageCode
string | null

The language code for the grade, used when the course is taught in a specific language.

Examples:

"SV"

null

teacher1EmployeeID
string<uuid> | null

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.

Examples:

"123e4567-e89b-12d3-a456-426614174000"

null

teacher2EmployeeID
string<uuid> | null

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.

Examples:

"123e4567-e89b-12d3-a456-426614174000"

null

grade
enum<string>

The grade awarded to the student.

Available options:
A,
B,
C,
D,
E,
F,
MISSING
Example:

"A"

gradeDate
string<date> | null

The date the grade was awarded.

Examples:

"2025-01-15"

null

gradeComment
string | null

A comment about the grade from the teacher.

Examples:

"Eleven har visat goda kunskaper i algebra."

null

extent
enum<string>

The extent of the course for this student.

Available options:
Normal,
Extended,
Reduced
Example:

"Normal"

schoolYear
enum<string>

The school year of the student at the time the grade was awarded.

Available options:
1,
2,
3
Example:

"2"

section
enum<string>

The section/type of the course in the student's study plan.

Available options:
General,
Program,
Orientation,
Specialization,
Individual,
Project,
Elementary
Example:

"Program"

teacherComment
string | null

A comment from the teacher about the student's performance.

Examples:

"Eleven deltar aktivt och visar stort engagemang."

null

programTitle
string | null

The title of the program this course belongs to. Used to associate the course with a specific educational program.

Examples:

"Teknikprogrammet"

null

startDate
string<date> | null

The date the student started the course.

Examples:

"2024-08-19"

null

endDate
string<date> | null

The date the student finished the course.

Examples:

"2025-01-17"

null