Skip to main content

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.

Returns all permissions currently assigned to the role identified by roleId. The query joins the permissionXRole pivot table with the permissions table to return full permission records. If the role has no assigned permissions, an empty array is returned — this endpoint does not return 404 for an unrecognised roleId.

Authentication

Requires a valid JWT in the Authorization header. No specific role permission is needed.

Request

Method: GET Path: /api/v1/permission/getByRoleId

Headers

Authorization
string
required
Bearer token obtained from the login endpoint. Format: Bearer <token>

Query Parameters

roleId
string
required
The numeric ID of the role whose permissions to retrieve. Must match ^\d+$ (digits only, no decimals or negative values).

Response

200 OK

Returns the list of permissions assigned to the specified role, ordered by idPermission.
success
boolean
Always true for successful responses.
message
string
Human-readable status message. Value: "Permiso obtenido por rol.".
data
array
Array of permission objects assigned to the role. Returns an empty array if the role has no permissions or does not exist.
Example Response
{
  "success": true,
  "message": "Permiso obtenido por rol.",
  "data": [
    {
      "idPermission": 1,
      "nameUri": "GET /api/v1/users",
      "description": "List all users"
    },
    {
      "idPermission": 3,
      "nameUri": "POST /api/v1/roles",
      "description": "Create a new role"
    }
  ]
}
Role With No Permissions Assigned
{
  "success": true,
  "message": "Permiso obtenido por rol.",
  "data": []
}

Error Responses

StatusDescription
400 Bad RequestroleId is missing or is not a numeric string.
401 UnauthorizedMissing or invalid JWT token.
400 Bad Request
{
  "success": false,
  "message": "Solicitud inválida",
  "data": null
}

Code Example

cURL
curl -X GET \
  -H "Authorization: Bearer <your_token>" \
  "http://localhost:3000/api/v1/permission/getByRoleId?roleId=1"

Socket.IO Events

This is a read-only endpoint. A data:changed broadcast is not emitted. The requesting client receives operation:progress events for the permissions:fetchByRole operation on their own socket only.
EventTargetOperationStatus sequence
operation:progressRequesting socketpermissions:fetchByRolestartsuccess

Build docs developers (and LLMs) love