Users
User management operations
Retrieves the currently authenticated user's information.
Current user's information.
Unauthorized.
GET /api/v1/users/current HTTP/1.1
Host: localhost:3000
Accept: */*
{
"_id": "text",
"email": "[email protected]",
"role": "retailer",
"verified": true,
"createdAt": "2025-10-21T06:01:19.734Z",
"updatedAt": "2025-10-21T06:01:19.734Z"
}
Updates the currently authenticated user's information.
User's new email address.
User's new password (at least 6 characters).
User updated successfully.
No content
Bad request (e.g., invalid input).
Unauthorized.
PUT /api/v1/users/current HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 48
{
"email": "[email protected]",
"password": "password"
}
No content
Retrieves a list of all users (admin only).
The number of users to return.
10
The number of users to skip.
0
A list of users.
Unauthorized.
Forbidden.
GET /api/v1/users HTTP/1.1
Host: localhost:3000
Accept: */*
[
{
"_id": "text",
"email": "[email protected]",
"role": "retailer",
"verified": true,
"createdAt": "2025-10-21T06:01:19.734Z",
"updatedAt": "2025-10-21T06:01:19.734Z"
}
]
Retrieves a user by their ID (admin only).
The ID of the user to retrieve.
The user's information.
Unauthorized.
Forbidden.
Not found.
GET /api/v1/users/{userId} HTTP/1.1
Host: localhost:3000
Accept: */*
{
"_id": "text",
"email": "[email protected]",
"role": "retailer",
"verified": true,
"createdAt": "2025-10-21T06:01:19.734Z",
"updatedAt": "2025-10-21T06:01:19.734Z"
}
Deletes a user by their ID (admin only).
The ID of the user to delete.
User deleted successfully.
No content
Unauthorized.
Forbidden.
Not found.
DELETE /api/v1/users/{userId} HTTP/1.1
Host: localhost:3000
Accept: */*
No content