Skip to content

Create Classes

Endpoint used to create and link a class to a school, defining its type, code, and title, and associating it with groups, subgroups, and specialties.

Warning: This endpoint will only work correctly if the domain of your institution is manually provided in the URL. Otherwise, the endpoint may fail or return a validation error.

Terminal window
curl --request POST \
--url 'https://{your-institution-domain}/api/v1/schools/{schoolId}/classrooms' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"schoolId": "<string>",
"type": "FILTER",
"code": "ABC123",
"title": "<string>",
"group": [1, 2],
"subgroups": [1],
"specialties": [1]
}'
{
"success": true,
"data": {
"id": 1,
"schoolId": "<string>",
"title": "<string>",
"code": "<string>",
"image": null,
"course": null,
"group": [{ "id": 1, "name": "<string>" }],
"subgroups": [{ "id": 1, "name": "<string>" }],
"specialties": [{ "id": 1, "name": "<string>" }],
"trails": [],
"contents": [],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}

ParameterTypeDescriptionRequired
AuthorizationStringAccess token (“Bearer” must be before the token)Yes
ParameterTypeDescriptionRequired
schoolIdstringIdentifier of the school to which the class will be associated.Yes
typestringType of class to be established, based on filtering groups, subgroups, and specialties.Yes
codestringClass code: unique identifier with 1 to 10 characters.Yes
titlestringClass title: string description with up to 255 characters.Yes
grouparrayGroups: set of group identifiers related to the class. Required if type is FILTER.No
subgroupsarraySubgroups: set of subgroup identifiers associated with the class. Required if type is FILTER.No
specialtiesarraySpecialties: set of specialty identifiers linked to the class. Required if type is FILTER.No
contentsarrayExclusive content items. Required when type is EXCLUSIVE_CONTENT.No
registration_start_datestringEnrollment start date.No
registration_end_datestringEnrollment end date.No

KeyTypeDescription
successbooleanIndicates if the request was successful.
dataobjectDetails of the created class.
data.idnumberUnique identifier of the class.
data.schoolIdstringIdentifier of the associated school.
data.titlestringClass title.
data.codestringClass code.
data.imagestringClass image URL (may be null).
data.coursestringName of the associated course (may be null).
data.grouparrayList of groups associated with the class.
data.subgroupsarrayList of subgroups associated with the class.
data.specialtiesarrayList of specialties associated with the class.
data.trailsarrayList of trails associated with the class.
data.contentsarrayList of content items associated with the class.
data.createdAtstringDate and time the class was created.
data.updatedAtstringDate and time the class was last updated.

To access this endpoint, it is necessary to send a valid access token through the authorization header (Authorization) of the request. Additionally, the API is protected by other security measures to safeguard user data.