TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TheSerchCp/SEAM-API/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/v1/users/:id endpoint retrieves a single user record by their numeric primary key. The response includes the user’s role name and role description via a LEFT JOIN with the roles table. The password field is never included in the response.
This endpoint requires a valid JWT token and that the caller’s role has the GET /api/v1/users/:id permission registered in the database.
Endpoint
http://localhost:{PORT}/api/v1
Authentication: JWT Bearer token + role permission GET /api/v1/users/:id
Path Parameters
The numeric ID of the user to retrieve. Must match the pattern
^\d+$ (one or more digits, no other characters). This is validated by validate.middleware against getByIdSchema before the controller is reached.Example Request
Responses
200 OK
Returned when the token is valid, the role has the required permission, and a user with the given ID exists in the database.Always
true for successful responses.Human-readable confirmation:
"Usuario obtenido exitosamente".The matched user record.
400 Bad Request — Invalid ID Format
Returned when the:id path segment does not match ^\d+$ (e.g., letters, special characters, or a floating-point number are supplied).
401 Unauthorized
Returned when theAuthorization header is missing, the token is malformed, or the token has expired.
403 Forbidden
Returned when the JWT is valid but the caller’s role does not haveGET /api/v1/users/:id listed in the permissionXRole table.
404 Not Found
Returned when no user with the given numeric ID exists in theusers table. The service throws a NotFoundError which the global error middleware maps to HTTP 404.
Permission Setup
For a role to access this endpoint, a record must exist in thepermissions table with nameUri = "GET /api/v1/users/:id" and that permission must be linked to the role in the permissionXRole pivot table.
The roles.middleware derives the URI automatically from the Express route pattern:
/:id is the route pattern, not the resolved value — the literal string :id must be stored as the nameUri in the permissions table.