Enrollments
Students enrolled in a class.
List the class's enrollments
GET /turmas/{turmaId}/matriculas
Access: Requires the capability LER over class (params.turmaId). Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
turmaId | string (uuid) | yes | Class id. |
Query parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
busca | string | no | to 100 characters | Search text (name or email, depending on the route). |
limite | integer | no | 1…200; default: 50 | How many items per page (1 to 200; the default varies by route, usually 50). |
deslocamento | integer | no | 0…100000; default: 0 | How many items to skip, for paging (up to 100000). |
inativos | "true" | "false" | no | default: "false" | true also includes inactive records. |
Response
list of MatriculaDto (+ total)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
turmaId | string (uuid) | yes | ||
usuarioId | string (uuid) | yes | ||
ativo | boolean | yes | ||
nome | string | yes | ||
email | string | yes | ||
status | "CONVIDADO" | "ATIVO" | "SUSPENSO" | yes | ||
jaExistia | boolean | no | Only in the create-by-email response: the email already had an account and the person was bound to it. |
On error: ErroApi model.
Example
curl -X GET "$API/turmas/{turmaId}/matriculas" -H "Authorization: Bearer $TOKEN"Enroll a student in the class
POST /turmas/{turmaId}/matriculas
Provide usuarioId (existing student) or email and nome (new account, with an invitation by email).
Access: Requires the capability CADASTRAR over class (params.turmaId). Rate limit: up to 120 calls every 60 s per origin. Success status: 201.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
turmaId | string (uuid) | yes | Class id. |
Request body (MatriculaCriar)
Option 1
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
usuarioId | string (uuid) | yes |
Option 2
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
email | yes | |||
nome | string | yes | 1–200 characters | |
nationality | string | no | 2–2 characters; ^[A-Za-z]{2}$ |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
turmaId | string (uuid) | yes | ||
usuarioId | string (uuid) | yes | ||
ativo | boolean | yes | ||
nome | string | yes | ||
email | string | yes | ||
status | "CONVIDADO" | "ATIVO" | "SUSPENSO" | yes | ||
jaExistia | boolean | no | Only in the create-by-email response: the email already had an account and the person was bound to it. |
On error: ErroApi model.
Example
curl -X POST "$API/turmas/{turmaId}/matriculas" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"usuarioId":"0198a000-0000-7000-8000-000000000001"}'Activate or deactivate an enrollment
PATCH /turmas/{turmaId}/matriculas/{matriculaId}
Deactivating an enrollment only toggles ativo: nothing is deleted, and reactivating puts the student back in the class.
Access: Requires the capability CADASTRAR over class (params.turmaId). Success status: 200.
Path parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
matriculaId | string (uuid) | yes | Enrollment id. | |
turmaId | string (uuid) | yes | Class id. |
Request body (MatriculaAtualizar)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
ativo | boolean | yes |
Response
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | yes | ||
turmaId | string (uuid) | yes | ||
usuarioId | string (uuid) | yes | ||
ativo | boolean | yes | ||
nome | string | yes | ||
email | string | yes | ||
status | "CONVIDADO" | "ATIVO" | "SUSPENSO" | yes | ||
jaExistia | boolean | no | Only in the create-by-email response: the email already had an account and the person was bound to it. |
On error: ErroApi model.
Example
curl -X PATCH "$API/turmas/{turmaId}/matriculas/{matriculaId}" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"ativo":false}'