This admin-only endpoint returns a paginated list of every registered user in the TuKit database, ordered byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/tukit/llms.txt
Use this file to discover all available pages before exploring further.
createdAt ascending (oldest accounts first). Pagination is handled by the Paginate middleware, which reads the optional pag and perpage path parameters and attaches skippag and limit values to req.body before the controller runs. The requesting user must be identified by adminId in the URL and must hold the role { name: "admin", value: "2" } — standard users will receive a 203 rejection. Pagination metadata is returned alongside the user array so clients can implement page-based navigation.
POST /api/user/list/:adminId/user/:pag?/:perpage?
Authentication
Path Parameters
The MongoDB ObjectId of the requesting administrator. This account must carry the role
{ name: "admin", value: "2" } or the request will be rejected.The page number to retrieve. Defaults to
1 when omitted. Must be a positive integer.The number of user records to return per page. Defaults to
10 when omitted.Request Body
No request body is required for this endpoint. Pagination values (skippag, limit) are computed and injected by the Paginate middleware from the path parameters.
Response
200 — Success
Loading message returned with the data:
"Cargando usuarios...".Always
true on success.Array of user documents matching the current page. Users are sorted by
createdAt ascending.Metadata about the current page and total pages available.
Error Responses
| Status | Cause |
|---|---|
203 | The adminId account does not hold the role { name: "admin", value: "2" }, or no user document was found for adminId. |
500 | Unexpected server or database error. |
The result set is sorted by
createdAt in ascending order — the oldest registered accounts appear first. Use the pag and perpage path parameters to navigate through large user bases.