POST /api/v1/register

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.

application/json

Body Required

User registration information

  • firstname string Required
  • lastname string Required
  • email string Required
  • role string Required
  • phone string Required
  • password string Required

Responses

  • 201 application/json

    User registered successfully

    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 registration data or validation errors

  • 500 application/json

    Server error during registration process

POST /api/v1/register
curl \
 --request POST 'https://api.echoplain.social/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
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
}