Creates a new role in the system. 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.
roleName must be unique — attempting to create a role with a name that already exists (case-insensitive) returns 409 Conflict. On success, the full role record including its auto-generated idRole is returned.
After a successful creation, a data:changed Socket.IO event is broadcast to all connected clients so their UI can refresh the roles list.
Authentication
Requires a valid JWT and thePOST /api/v1/roles permission assigned to the caller’s role.
Request
Method:POST
Path: /api/v1/roles
Headers
Bearer token obtained from the login endpoint. Format:
Bearer <token>Must be
application/json.Body
The unique name for the role. Must be between 2 and 50 characters. The uniqueness check is case-insensitive.
Optional human-readable description explaining the role’s purpose. Stored as
null if omitted.Example Request Body
Response
201 Created
Returns the newly created role object.Always
true for successful responses.Human-readable status message. Value:
"Rol creado exitosamente".The created role record.
Example Response
Error Responses
| Status | Description |
|---|---|
400 Bad Request | Validation failed — roleName is missing, too short, or too long. |
401 Unauthorized | Missing or invalid JWT token. |
403 Forbidden | Authenticated user’s role lacks the POST /api/v1/roles permission. |
409 Conflict | A role with the given roleName already exists (case-insensitive match). |
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:create | start → processing → success |
data:changed | All connected clients | roles:create | Broadcast with the new 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.