Skip to main content
PATCH
/
group
/
{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.groups.update(id="123e4567-e89b-12d3-a456-426614174000", title="1A", external={
        "source_id": "12345678",
    }, types=[
        "Class",
    ], moderator_i_ds=[
        "123e4567-e89b-12d3-a456-426614174000",
    ], member_i_ds=[
        "123e4567-e89b-12d3-a456-426614174000",
    ])

    # 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"
  },
  "schoolID": "123e4567-e89b-12d3-a456-426614174000",
  "category": "Education",
  "title": "1A",
  "types": [
    "Class"
  ],
  "moderatorIDs": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "memberIDs": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}

Authorizations

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

Path Parameters

id
string<uuid>
required

The unique identifier of the Group to update

Example:

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

Body

application/json

Request body

title
string
required

The title of the group, must be unique within the school.

Example:

"1A"

external
object

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

Example:
{ "sourceID": "12345678" }
types
enum<string>[]

The types of the group. A group can have multiple types simultaneously. For preschools (FS), Class and Childcare types are automatically paired - adding Class will automatically include Childcare, and vice versa. Integration note for Mentor type - when importing groups from external systems, it can be difficult to determine whether a group should have the Mentor type. One recommended approach is to not include the Mentor type when creating or updating groups via the API, allowing school administrators to manually configure the Mentor type in Meitner as needed. When updating a group, you can preserve existing types by reading the current group state first and only modifying the specific types your integration manages (e.g., Class, Childcare). This ensures the Mentor type remains under administrator control.

The type of the group. A group can have multiple types simultaneously, each enabling specific functionality for the group's members and moderators.

Available options:
Class,
Childcare,
Mentor
Example:
["Class"]
moderatorIDs
string<uuid>[]

The IDs of the moderators of the group. Can be any user type (Student, Employee, Guardian) if the Category is Other. If the Category is Education, the Moderators have to be employees of the school.

Example:
["123e4567-e89b-12d3-a456-426614174000"]
memberIDs
string<uuid>[]

The IDs of the members of the group. Can be any user type (Student, Employee, Guardian) if the Category is Other. If the Category is Education, the Members have to be students of the school.

Example:
["123e4567-e89b-12d3-a456-426614174000"]

Response

Response for Group Update operation - returns the updated Group

Group holds the information about a group of students.

id
string<uuid>
required

Unique identifier for the Group

Example:

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

schoolID
string<uuid>
required

The ID of the school the group belongs to

Example:

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

title
string
required

The title of the group, must be unique within the school.

Example:

"1A"

meta
object

Metadata information for the Group

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

Example:
{
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
}
category
enum<string>
default:Education

If the category is Education, the ModeratorIDs have to be employees and the MemberIDs have to be students of the school. If the category is Other, it will not be possible to use the IsClass, IsChildcare and IsMentor fields.

Available options:
Education,
Other
Example:

"Education"

types
enum<string>[]

The types of the group. A group can have multiple types simultaneously. For preschools (FS), Class and Childcare types are automatically paired - adding Class will automatically include Childcare, and vice versa. Integration note for Mentor type - when importing groups from external systems, it can be difficult to determine whether a group should have the Mentor type. One recommended approach is to not include the Mentor type when creating or updating groups via the API, allowing school administrators to manually configure the Mentor type in Meitner as needed. When updating a group, you can preserve existing types by reading the current group state first and only modifying the specific types your integration manages (e.g., Class, Childcare). This ensures the Mentor type remains under administrator control.

The type of the group. A group can have multiple types simultaneously, each enabling specific functionality for the group's members and moderators.

Available options:
Class,
Childcare,
Mentor
Example:
["Class"]
moderatorIDs
string<uuid>[]

The IDs of the moderators of the group. Can be any user type (Student, Employee, Guardian) if the Category is Other. If the Category is Education, the Moderators have to be employees of the school.

Example:
["123e4567-e89b-12d3-a456-426614174000"]
memberIDs
string<uuid>[]

The IDs of the members of the group. Can be any user type (Student, Employee, Guardian) if the Category is Other. If the Category is Education, the Members have to be students of the school.

Example:
["123e4567-e89b-12d3-a456-426614174000"]