Skip to content

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

ParameterTypeRequiredConstraintsDescription
turmaIdstring (uuid)yesClass id.

Query parameters

ParameterTypeRequiredConstraintsDescription
buscastringnoto 100 charactersSearch text (name or email, depending on the route).
limiteintegerno1…200; default: 50How many items per page (1 to 200; the default varies by route, usually 50).
deslocamentointegerno0…100000; default: 0How many items to skip, for paging (up to 100000).
inativos"true" | "false"nodefault: "false"true also includes inactive records.

Response

list of MatriculaDto (+ total)

FieldTypeRequiredConstraintsDescription
idstring (uuid)yes
turmaIdstring (uuid)yes
usuarioIdstring (uuid)yes
ativobooleanyes
nomestringyes
emailstringyes
status"CONVIDADO" | "ATIVO" | "SUSPENSO"yes
jaExistiabooleannoOnly in the create-by-email response: the email already had an account and the person was bound to it.

On error: ErroApi model.

Example

bash
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

ParameterTypeRequiredConstraintsDescription
turmaIdstring (uuid)yesClass id.

Request body (MatriculaCriar)

Option 1

FieldTypeRequiredConstraintsDescription
usuarioIdstring (uuid)yes

Option 2

FieldTypeRequiredConstraintsDescription
emailEmailyes
nomestringyes1–200 characters
nationalitystringno2–2 characters; ^[A-Za-z]{2}$

Response

MatriculaDto

FieldTypeRequiredConstraintsDescription
idstring (uuid)yes
turmaIdstring (uuid)yes
usuarioIdstring (uuid)yes
ativobooleanyes
nomestringyes
emailstringyes
status"CONVIDADO" | "ATIVO" | "SUSPENSO"yes
jaExistiabooleannoOnly in the create-by-email response: the email already had an account and the person was bound to it.

On error: ErroApi model.

Example

bash
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

ParameterTypeRequiredConstraintsDescription
matriculaIdstring (uuid)yesEnrollment id.
turmaIdstring (uuid)yesClass id.

Request body (MatriculaAtualizar)

FieldTypeRequiredConstraintsDescription
ativobooleanyes

Response

MatriculaDto

FieldTypeRequiredConstraintsDescription
idstring (uuid)yes
turmaIdstring (uuid)yes
usuarioIdstring (uuid)yes
ativobooleanyes
nomestringyes
emailstringyes
status"CONVIDADO" | "ATIVO" | "SUSPENSO"yes
jaExistiabooleannoOnly in the create-by-email response: the email already had an account and the person was bound to it.

On error: ErroApi model.

Example

bash
curl -X PATCH "$API/turmas/{turmaId}/matriculas/{matriculaId}" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"ativo":false}'

contato@presente.app.br