Registers a new permission in the system by recording aDocumentation 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.
nameUri route pattern and its description. The roles.middleware performs a case-insensitive SQL lookup against this table on every protected request, so the nameUri you register must exactly match the HTTP method and path pattern of the route you want to guard.
After a successful registration, a data:changed Socket.IO event is broadcast to all connected clients.
Valid
nameUri values follow the pattern METHOD /api/v1/path, where METHOD is uppercase and the path matches the Express route exactly — including any named parameters in :param format. Examples:GET /api/v1/usersPOST /api/v1/rolesPUT /api/v1/roles/:idRoleDELETE /api/v1/users/:idPOST /api/v1/permission/assign
Authentication
Requires a valid JWT and thePOST /api/v1/permission/register permission assigned to the caller’s role.
Request
Method:POST
Path: /api/v1/permission/register
Headers
Bearer token obtained from the login endpoint. Format:
Bearer <token>Must be
application/json.Body
The route pattern to protect. Must be between 2 and 100 characters. Should follow the format
METHOD /api/v1/path, e.g. DELETE /api/v1/roles/:idRole.Human-readable description of what access this permission grants. Required (unlike the
description field on roles).Example Request Body
Response
201 Created
Returns the newly created permission record.Always
true for successful responses.Human-readable status message. Value:
"Permiso registrado exitosamente".The registered permission record.
Example Response
Error Responses
| Status | Description |
|---|---|
400 Bad Request | Validation failed — a required field is missing or nameUri is outside the 2–100 character range. |
401 Unauthorized | Missing or invalid JWT token. |
403 Forbidden | Authenticated user’s role lacks the POST /api/v1/permission/register permission. |
409 Conflict | A permission with the same nameUri (case-insensitive) already exists. |
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 | permissions:create | start → processing → success |
data:changed | All connected clients | permissions:create | Broadcast with the new permission 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.