Updates one or both fields (Documentation 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.
roleName, description) of an existing role identified by its numeric idRole path parameter. All body fields are optional — only fields present in the request body are applied. If roleName is provided and differs from the current value, its uniqueness is validated (case-insensitive) before saving. The full updated record is returned.
After a successful update, a data:changed Socket.IO event is broadcast to all connected clients.
Authentication
Requires a valid JWT and thePUT /api/v1/roles/:idRole permission assigned to the caller’s role.
Request
Method:PUT
Path: /api/v1/roles/:idRole
Headers
Bearer token obtained from the login endpoint. Format:
Bearer <token>Must be
application/json.Path Parameters
The numeric ID of the role to update. Must match
^\d+$ (digits only, no decimals or negative values).Body
All body fields are optional. At least one should be provided to make a meaningful request.New name for the role. Must be between 2 and 50 characters and must not conflict with an existing role name (case-insensitive).
New description for the role. Pass an empty string to clear the current description.
Example Request Body
Response
200 OK
Returns the full updated role object as it now exists in the database.Always
true for successful responses.Human-readable status message. Value:
"Rol actualizado exitosamente".The updated role record fetched from the database after the update is applied.
Example Response
Error Responses
| Status | Description |
|---|---|
400 Bad Request | idRole is not numeric, or roleName fails length validation. |
401 Unauthorized | Missing or invalid JWT token. |
403 Forbidden | Authenticated user’s role lacks the PUT /api/v1/roles/:idRole permission. |
404 Not Found | No role exists with the given idRole. |
409 Conflict | The provided roleName is already used by a different role. |
404 Not Found
409 Conflict
Code Example
cURL
Socket.IO Events
On success, the server emits the following events:| Event | Target | Operation | Status sequence |
|---|---|---|---|
operation:progress | Requesting socket | roles:update | start → processing → success |
data:changed | All connected clients | roles:update | Broadcast with the updated role object |
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.