GET /api/v1/users

Retrieve a comprehensive list of all users in the system including their profiles, roles, and status information. Requires Admin or Lecturer privileges.

Responses

  • 200 application/json

    All users retrieved successfully

  • 400 application/json

    Default bad request error 400 response

    Hide response attributes Show response attributes object
    • message string Required

      Response message

    • error string Required
    • statusCode number Required
  • 401 application/json

    Authentication token required

  • 403 application/json

    Admin or Lecturer privileges required

GET /api/v1/users
curl \
 --request GET 'https://api.echoplain.social/api/v1/users'
Response examples (200)
[
  {
    "id": "user-uuid-1",
    "role": "STUDENT",
    "email": "john.doe@university.edu",
    "phone": "+254712345678",
    "status": "ACTIVE",
    "lastname": "Doe",
    "createdAt": "2024-01-15T10:30:00Z",
    "firstname": "John",
    "updatedAt": "2024-01-15T10:30:00Z",
    "instituteid": "institute-uuid-here"
  },
  {
    "id": "user-uuid-2",
    "role": "LECTURER",
    "email": "jane.smith@university.edu",
    "phone": "+254712345679",
    "status": "ACTIVE",
    "lastname": "Smith",
    "createdAt": "2024-01-10T08:15:00Z",
    "firstname": "Dr. Jane",
    "updatedAt": "2024-01-20T14:45:00Z",
    "instituteid": "institute-uuid-here"
  },
  {
    "id": "user-uuid-3",
    "role": "ADMIN",
    "email": "admin@university.edu",
    "phone": "+254712345680",
    "status": "ACTIVE",
    "lastname": "User",
    "createdAt": "2024-01-01T00:00:00Z",
    "firstname": "Admin",
    "updatedAt": "2024-01-01T00:00:00Z",
    "instituteid": "institute-uuid-here"
  }
]
Response examples (400)
{
  "message": "string",
  "error": "string",
  "statusCode": 42.0
}
Response examples (401)
{
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 401
}
Response examples (403)
{
  "error": "Forbidden",
  "message": "Insufficient permissions. Admin or Lecturer role required.",
  "statusCode": 403
}