Creates Keycloak user accounts for multiple enrolled students and sends invitation emails with auto-generated credentials
POST
/classes/{classId}/students/bulk-create-accounts
curl \
--request POST 'https://api.huy-devops.site/api/classes/{classId}/students/bulk-create-accounts' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"studentIds":["550e8400-e29b-41d4-a716-446655440010","550e8400-e29b-41d4-a716-446655440011"]}'
Request examples
{
"studentIds": [
"550e8400-e29b-41d4-a716-446655440010",
"550e8400-e29b-41d4-a716-446655440011"
]
}
Response examples (200)
{
"success": true,
"code": 200,
"message": "string",
"data": {
"totalCreated": 5,
"totalFailed": 1,
"createdAccounts": [
{
"studentId": "string",
"username": "string",
"temporaryPassword": "string"
}
],
"failedAccounts": [
{
"studentId": "string",
"reason": "string"
}
]
}
}
Response examples (400)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (401)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (403)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}