POST /classes/{classId}/students/bulk-create-accounts

Creates Keycloak user accounts for multiple enrolled students and sends invitation emails with auto-generated credentials

Path parameters

  • classId string Required

    ID of the class

application/json

Body Required

  • studentIds array[string] Required

    Array of Student IDs to create accounts for

Responses

  • 200 application/json

    Student accounts created successfully

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data object
      Hide data attributes Show data attributes object
      • totalCreated integer
      • totalFailed integer
      • createdAccounts array[object]
        Hide createdAccounts attributes Show createdAccounts attributes object
        • studentId string
        • username string
        • temporaryPassword string
      • failedAccounts array[object]
        Hide failedAccounts attributes Show failedAccounts attributes object
        • studentId string
        • reason string
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 403 application/json

    Forbidden - Only class owner can perform this action

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 404 application/json

    Class not found

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
POST /classes/{classId}/students/bulk-create-accounts
curl \
 --request POST 'http://localhost:8080/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"
}