POST /api/v1/register/batch/lecturers

Register multiple lecturers in a single operation with institutional information. Requires admin privileges for batch lecturer operations.

application/json

Body Required

Array of lecturer registration data for batch processing

  • lecturers array[object] Required
    Hide lecturers attributes Show lecturers attributes object
    • firstname string Required
    • lastname string Required
    • email string Required
    • role string Required
    • phone string Required
    • password string Required
    • instituteid string Required
    • departmentInchargeId string

Responses

  • 201 application/json

    Batch lecturer registration completed with success and failure counts

    Hide response attributes Show response attributes object
    • message string Required
    • results array[object] Required
      Hide results attributes Show results attributes object
      • message string Required
      • user object Required
        Hide user attribute Show user attribute object
        • id string Required
  • 400 application/json

    Invalid batch data or duplicate lecturer emails

  • 401 application/json

    Authentication required for batch operations

  • 403 application/json

    Admin privileges required for batch lecturer registration

POST /api/v1/register/batch/lecturers
curl \
 --request POST 'http://localhost:3500/api/v1/register/batch/lecturers' \
 --header "Content-Type: application/json" \
 --data '{"lecturers":[{"role":"LECTURER","email":"sarah.wilson@university.edu","phone":"+254712345686","lastname":"Wilson","password":"LecturerPass123!","firstname":"Dr. Sarah","instituteid":"institute-uuid-here","departmentInchargeId":"cs-department-uuid"},{"role":"LECTURER","email":"michael.brown@university.edu","phone":"+254712345687","lastname":"Brown","password":"LecturerPass456!","firstname":"Prof. Michael","instituteid":"institute-uuid-here"}]}'
Request example
Register multiple lecturers with institutional details
{
  "lecturers": [
    {
      "role": "LECTURER",
      "email": "sarah.wilson@university.edu",
      "phone": "+254712345686",
      "lastname": "Wilson",
      "password": "LecturerPass123!",
      "firstname": "Dr. Sarah",
      "instituteid": "institute-uuid-here",
      "departmentInchargeId": "cs-department-uuid"
    },
    {
      "role": "LECTURER",
      "email": "michael.brown@university.edu",
      "phone": "+254712345687",
      "lastname": "Brown",
      "password": "LecturerPass456!",
      "firstname": "Prof. Michael",
      "instituteid": "institute-uuid-here"
    }
  ]
}
Response examples (201)
{
  "message": "Batch lecturer registration completed",
  "results": [
    {
      "email": "sarah.wilson@university.edu",
      "status": "success",
      "userId": "lecturer-uuid-1"
    },
    {
      "email": "michael.brown@university.edu",
      "status": "success",
      "userId": "lecturer-uuid-2"
    }
  ],
  "failureCount": 0,
  "successCount": 2
}
Response examples (400)
{
  "error": "Bad Request",
  "message": "Duplicate emails found in batch",
  "statusCode": 400
}
Response examples (401)
{
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 401
}
Response examples (403)
{
  "error": "Forbidden",
  "message": "Insufficient permissions for batch lecturer operations",
  "statusCode": 403
}