Creates an entry in 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.
permissionXRole pivot table that links a permissionId to a roleId. Once assigned, all users whose role matches roleId are granted access to the route identified by that permission. The assignment takes effect immediately — subsequent requests from users with that role will pass the roles.middleware check for the associated route.
The underlying INSERT IGNORE statement means that if the assignment already exists, no error is raised and the operation is treated as a no-op at the database level. A data:changed Socket.IO event is broadcast regardless.
Authentication
Requires a valid JWT and thePOST /api/v1/permission/assign permission assigned to the caller’s role.
Request
Method:POST
Path: /api/v1/permission/assign
Headers
Bearer token obtained from the login endpoint. Format:
Bearer <token>Must be
application/json.Body
The numeric ID of the role to assign the permission to. Must be a JSON number (not a string).
The numeric ID of the permission to assign. Must be a JSON number (not a string). Retrieve this from List Permissions or Get by URI.
Example Request Body
Response
200 OK
Returned when the assignment is successfully created (or silently ignored as a duplicate).Always
true for successful responses.Human-readable confirmation message. Value:
"Permiso asignado al rol exitosamente".Always
null for this operation.Example Response
Error Responses
| Status | Description |
|---|---|
400 Bad Request | roleId or permissionId is missing or not a JSON number type. |
401 Unauthorized | Missing or invalid JWT token. |
403 Forbidden | Authenticated user’s role lacks the POST /api/v1/permission/assign permission. |
409 Conflict | Foreign-key violation — the specified roleId or permissionId does not exist. |
400 Bad Request — Wrong Type
Code Example
cURL
Socket.IO Events
On success, the server emits the following events:| Event | Target | Operation | Status sequence |
|---|---|---|---|
operation:progress | Requesting socket | permissions:assign | start → success |
data:changed | All connected clients | permissions:assign | Broadcast with no data payload (null) |
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.