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 roles currently registered in the system, up to a maximum of 200 records. This endpoint intentionally skips the roles-middleware permission check so that any authenticated user can fetch the role list — for example, to populate a dropdown in a user-creation form.

Authentication

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

Request

Method: GET Path: /api/v1/roles

Headers

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

Response

200 OK

Returns the full list of roles, ordered as stored in the database (up to 200 records).
success
boolean
Always true for successful responses.
message
string
Human-readable status message. Value: "Roles obtenidos".
data
array
Array of role objects.
Example Response
{
  "success": true,
  "message": "Roles obtenidos",
  "data": [
    {
      "idRole": 1,
      "roleName": "Admin",
      "description": "Full system access"
    },
    {
      "idRole": 2,
      "roleName": "Editor",
      "description": "Can create and edit content"
    },
    {
      "idRole": 3,
      "roleName": "Viewer",
      "description": null
    }
  ]
}

Error Responses

StatusDescription
401 UnauthorizedMissing or invalid JWT token.
401 Unauthorized
{
  "success": false,
  "message": "No autorizado",
  "data": null
}

Code Example

cURL
curl -X GET http://localhost:3000/api/v1/roles \
  -H "Authorization: Bearer <your_token>"

Socket.IO Events

This is a read-only endpoint. No socket events are emitted — neither operation:progress nor data:changed are sent for this operation.

Build docs developers (and LLMs) love