Register a new user with basic information and role assignment. This endpoint creates a user account with specified role (Student, Lecturer, or Admin) and basic profile information.
POST
/api/v1/register
curl \
--request POST 'http://localhost:3500/api/v1/register' \
--header "Content-Type: application/json" \
--data '{"role":"STUDENT","email":"john.doe@university.edu","phone":"+254712345678","lastname":"Doe","password":"SecurePass123!","firstname":"John"}'
Request examples
Student Registration
Register a new student user
{
"role": "STUDENT",
"email": "john.doe@university.edu",
"phone": "+254712345678",
"lastname": "Doe",
"password": "SecurePass123!",
"firstname": "John"
}
Register a new lecturer user
{
"role": "LECTURER",
"email": "jane.smith@university.edu",
"phone": "+254712345679",
"lastname": "Smith",
"password": "LecturerPass456!",
"firstname": "Dr. Jane"
}
Register a new admin user
{
"role": "ADMIN",
"email": "admin@university.edu",
"phone": "+254712345680",
"lastname": "User",
"password": "AdminPass789!",
"firstname": "Admin"
}
Response examples (201)
{
"user": {
"id": "uuid-string-here"
},
"message": "User registered successfully"
}
Response examples (400)
{
"error": "Bad Request",
"message": [
"email must be an email",
"password is not strong enough",
"phone must be a valid phone number"
],
"statusCode": 400
}
Response examples (500)
{
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 500
}