Enroll Students in a Class
Endpoint used to indicate a class and send one or more student objects to register them in the class in Toolzz LMS.
Request Example
Section titled “Request Example”curl --request POST \ --url 'https://kong.api.toolzz.com.br/api/classes/{class_id}/attach' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "users": [ { "name": "Student Name", "email": "student@example.com", "birth_date": "2000-01-01", "cpf": "12345678901", "registration_start_date": "2025-01-01", "registration_end_date": "2025-12-31", "enrollment_renewal": false } ] }'Response Example
Section titled “Response Example”{ "data": [ { "user_id": 1, "user_name": "<string>", "school_id": 1, "class_id": "<string>", "class_name": "<string>", "birth_date": "<string>", "cpf": "<string>", "registration_start_date": "<string>", "registration_end_date": "<string>", "enrollment_renewal": false, "id": "<string>" } ]}Request description
Section titled “Request description”Access Token
Section titled “Access Token”| Parameter | Type | Description | Required |
|---|---|---|---|
Authorization | String | Access token (“Bearer” must be before the token) | Yes |
URL Parameters (Path)
Section titled “URL Parameters (Path)”| Parameter | Type | Description | Required |
|---|---|---|---|
class_id | string | Identifier of the class in which the student(s) will be enrolled. | Yes |
Body Parameters
Section titled “Body Parameters”| Parameter | Type | Description | Required |
|---|---|---|---|
users | array | List of users to be enrolled and registered. If the user already exists, they can be linked via ID using the id key with the corresponding value. | Yes |
users.name | string | Student name. Required for unregistered students. | No |
users.email | string | Student email address. Required for unregistered students. | No |
users.id | int | ID of the registered student in the institution. Optional for already registered users. | No |
birth_date | string | User’s date of birth in YYYY-MM-DD format. | No |
cpf | string | User’s CPF number, containing exactly 11 numeric digits. | No |
registration_start_date | string | User’s enrollment start date in YYYY-MM-DD format. | No |
registration_end_date | string | User’s enrollment end date in YYYY-MM-DD format. Must be equal to or after the current date. | No |
enrollment_renewal | boolean | Flag indicating whether the enrollment will be renewed. | No |
Response description
Section titled “Response description”| Key | Type | Description |
|---|---|---|
data | array | List of associations between users and the class. |
data.user_id | number | Unique identifier of the user. |
data.user_name | string | Name of the user. |
data.school_id | number | Unique identifier of the associated school. |
data.class_id | string | Unique identifier of the class. |
data.class_name | string | Name of the class. |
data.birth_date | string | User’s date of birth in YYYY-MM-DD format. |
data.cpf | string | User’s CPF, containing exactly 11 digits. |
data.registration_start_date | string | User’s enrollment start date in the class. |
data.registration_end_date | string | User’s enrollment end date in the class. |
data.enrollment_renewal | boolean | Indicates if the user’s enrollment was renewed (true) or not (false). |
data.id | string | Class identifier or code used for validation. May be numeric or alphanumeric. |
Security
Section titled “Security”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.