Permanently removes a role from the system by its numericDocumentation 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.
idRole. The role must exist — a missing role returns 404 Not Found. If any database records still reference this role via a foreign-key constraint (such as user-role assignments), the database raises an ER_ROW_IS_REFERENCED_2 error and the deletion fails with 409 Conflict.
After a successful deletion, a data:changed Socket.IO event is broadcast to all connected clients.
Authentication
Requires a valid JWT and theDELETE /api/v1/roles/:idRole permission assigned to the caller’s role.
Request
Method:DELETE
Path: /api/v1/roles/:idRole
Headers
Bearer token obtained from the login endpoint. Format:
Bearer <token>Path Parameters
The numeric ID of the role to delete. Must match
^\d+$ (digits only, no decimals or negative values).Response
200 OK
Returnsnull for data on a successful deletion.
Always
true for successful responses.Human-readable confirmation message. Value:
"Rol eliminado exitosamente".Always
null for delete operations.Example Response
Error Responses
| Status | Description |
|---|---|
400 Bad Request | idRole path parameter is not a valid numeric string. |
401 Unauthorized | Missing or invalid JWT token. |
403 Forbidden | Authenticated user’s role lacks the DELETE /api/v1/roles/:idRole permission. |
404 Not Found | No role exists with the given idRole. |
409 Conflict | The role is still referenced by other records (ER_ROW_IS_REFERENCED_2 foreign-key constraint). |
404 Not Found
409 Conflict — Foreign Key Constraint
Code Example
cURL
Socket.IO Events
On success, the server emits the following events:| Event | Target | Operation | Status sequence |
|---|---|---|---|
operation:progress | Requesting socket | roles:delete | start → processing → success |
data:changed | All connected clients | roles:delete | Broadcast with { idRole } of the deleted role |
data:changed can use the initiatorSocketId field in the payload to skip redundant UI updates if they already know the result from the HTTP response.