Skip to main content
PATCH
/
school
/
{id}
Python (SDK)
from meitner import Meitner, models
import os


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

    res = m_client.schools.update(id="123e4567-e89b-12d3-a456-426614174000", title="Meitner Grundskola", external={
        "source_id": "12345678",
    }, unit_code="12345678", csn_school_code="12345", municipality_code="0184")

    # 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"
  },
  "title": "Meitner Grundskola",
  "unitCode": "12345678",
  "csnSchoolCode": "12345",
  "municipalityCode": "0184",
  "schoolType": "GR"
}

Authorizations

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

Path Parameters

id
string<uuid>
required

The unique identifier of the School to update

Example:

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

Body

application/json

Request body

title
string
required

The title of the school

Example:

"Meitner Grundskola"

external
object

External is the External-object used on Update and Create operations, since it should only be allowed to set SourceID for the school, the Source-field is not included.

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

The School Unit Code provided by SCB, is used in reports and printed on grade documents

Examples:

"12345678"

null

csnSchoolCode
string | null

The School Code provided by CSN, required for reports to CSN

Examples:

"12345"

null

municipalityCode
string | null

Municipality code of the school, is used in reports and printed on grade documents

Examples:

"0184"

null

Response

Response for School Update operation - returns the updated School

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.

id
string<uuid>
required

Unique identifier for the School

Example:

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

title
string
required

The title of the school

Example:

"Meitner Grundskola"

schoolType
enum<string>
required

Type of schooling provided at the school

Available options:
GR,
GY,
FS
Example:

"GR"

meta
object

Metadata information for the School

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 school from another system, used for third-party integration tracking.

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

The School Unit Code provided by SCB, is used in reports and printed on grade documents

Examples:

"12345678"

null

csnSchoolCode
string | null

The School Code provided by CSN, required for reports to CSN

Examples:

"12345"

null

municipalityCode
string | null

Municipality code of the school, is used in reports and printed on grade documents

Examples:

"0184"

null