POST /api/v1/register/student

Register a new student with academic information including institute, department, cohort, and course assignments. Creates both user account and student academic profile.

application/json

Body Required

Student registration information with academic details

  • firstname string Required
  • lastname string Required
  • email string Required
  • role string Required
  • phone string Required
  • password string Required
  • instituteid string Required
  • Registration_number string Required
  • cohortId string Required
  • departmentId string Required
  • courseId string Required

Responses

  • 201 application/json

    Student registered successfully with academic profile

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

    Invalid student registration data or missing academic information

  • 500 application/json

    Error during student registration or academic profile creation

POST /api/v1/register/student
curl \
 --request POST 'http://localhost:3500/api/v1/register/student' \
 --header "Content-Type: application/json" \
 --data '{"role":"STUDENT","email":"alice.johnson@university.edu","phone":"+254712345681","cohortId":"cohort-uuid-here","courseId":"course-uuid-here","lastname":"Johnson","password":"StudentPass123!","firstname":"Alice","instituteid":"institute-uuid-here","departmentId":"department-uuid-here","Registration_number":"CS/2025/001"}'
Request example
Register student with full academic information
{
  "role": "STUDENT",
  "email": "alice.johnson@university.edu",
  "phone": "+254712345681",
  "cohortId": "cohort-uuid-here",
  "courseId": "course-uuid-here",
  "lastname": "Johnson",
  "password": "StudentPass123!",
  "firstname": "Alice",
  "instituteid": "institute-uuid-here",
  "departmentId": "department-uuid-here",
  "Registration_number": "CS/2025/001"
}
Response examples (201)
{
  "user": {
    "id": "student-uuid-here"
  },
  "message": "Student registered successfully"
}
Response examples (400)
{
  "error": "Bad Request",
  "message": [
    "Registration_number should not be empty",
    "instituteid must be a string",
    "departmentId should not be empty"
  ],
  "statusCode": 400
}
Response examples (500)
{
  "error": "Internal Server Error",
  "message": "Failed to create student profile",
  "statusCode": 500
}