Register a new student with academic information including institute, department, cohort, and course assignments. Creates both user account and student academic profile.
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
}