curl --request GET \
--url https://api.example.com/api/admin/users \
--header 'Authorization: <authorization>'{
"users": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"role": "<string>",
"isActive": true,
"isSuspended": true,
"suspensionReason": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"error": "<string>"
}curl --request GET \
--url https://api.example.com/api/admin/users \
--header 'Authorization: <authorization>'{
"users": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"role": "<string>",
"isActive": true,
"isSuspended": true,
"suspensionReason": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"error": "<string>"
}ADMIN role. Users with PATIENT or DOCTOR roles will receive a 403 Forbidden response.
ADMIN, PATIENT, or DOCTORcurl -X GET https://api.example.com/api/admin/users \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
[
{
"id": 1,
"name": "Dr. Sarah Johnson",
"email": "[email protected]",
"role": "DOCTOR",
"isActive": true,
"isSuspended": false,
"suspensionReason": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": 2,
"name": "John Smith",
"email": "[email protected]",
"role": "PATIENT",
"isActive": true,
"isSuspended": false,
"suspensionReason": null,
"createdAt": "2024-02-01T14:20:00.000Z",
"updatedAt": "2024-02-01T14:20:00.000Z"
},
{
"id": 3,
"name": "Admin User",
"email": "[email protected]",
"role": "ADMIN",
"isActive": true,
"isSuspended": false,
"suspensionReason": null,
"createdAt": "2024-01-01T08:00:00.000Z",
"updatedAt": "2024-01-01T08:00:00.000Z"
}
]
{
"error": "Access denied"
}
{
"error": "Unauthorized"
}
{
"error": "Error fetching users"
}