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.
DELETE /api/v1/users/:id endpoint permanently removes a user account from the database by their numeric primary key. The service verifies the user exists before issuing the delete query. On success the response returns null in the data field confirming the record has been removed.
This endpoint requires a valid JWT token and that the caller’s role has the DELETE /api/v1/users/:id permission registered in the database.
Endpoint
http://localhost:{PORT}/api/v1
Authentication: JWT Bearer token + role permission DELETE /api/v1/users/:id
Path Parameters
The numeric ID of the user to delete. Must match the pattern
^\d+$. Validated by validate.middleware against getByIdSchema before the controller runs.Example Request
Responses
200 OK
Returned when the user exists and the deletion completes successfully. Thedata field is null — there is no record to return after deletion.
Always
true for successful responses.Human-readable confirmation:
"Usuario eliminado exitosamente".Always
null — the deleted record is no longer available.400 Bad Request — Invalid ID Format
Returned when the:id path segment does not match ^\d+$ (letters, special characters, or decimals are rejected).
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 haveDELETE /api/v1/users/:id in the permissionXRole table.
404 Not Found
Returned when no user with the given ID exists in the database. The service callsfindById before deleting and throws NotFoundError if the record is absent.
409 Conflict — User Has Dependents
Returned when the database raisesER_ROW_IS_REFERENCED_2, meaning another table contains rows that reference this user via a foreign key constraint. The user cannot be deleted while dependent records exist.
Permission Setup
For a role to access this endpoint, a record must exist in thepermissions table with nameUri = "DELETE /api/v1/users/:id" and be linked to the role in permissionXRole. The roles.middleware derives this URI automatically from the Express route pattern: