Skip to main content

Paginated list

GET /api/perfil Returns a paginated list of profiles. Results are ordered by id descending, with a fixed page size of 5 records.

Query parameters

page
number
default:"1"
Page number to retrieve. Defaults to 1.
Case-insensitive substring filter applied to strNombrePerfil. Uses SQL ILIKE '%value%'.
isAdmin
string
Filter by administrator flag. Pass "true" to return only administrator profiles, "false" to return only non-administrator profiles. Omit to return all profiles regardless of flag.

Response

success
boolean
required
true when the query completes without error.
data
object[]
required
Array of profile objects for the requested page.
totalPages
number
required
Total number of pages available given the current filters and a page size of 5.

Error response

When an unexpected server error occurs the handler catches the exception and returns:
500
{
  "success": false,
  "message": "Ocurrió un error al consultar los perfiles."
}

Examples

curl --request GET \
  --url 'https://your-domain.com/api/perfil?page=1&search=admin&isAdmin=true' \
  --cookie 'auth_token=<your-jwt>'

Success response

200
{
  "success": true,
  "data": [
    {
      "id": 3,
      "strNombrePerfil": "Administrador",
      "bitAdministrador": true
    }
  ],
  "totalPages": 2
}

Simple list (for dropdowns)

GET /api/perfil/list Returns all profiles without pagination. Only id and strNombrePerfil are included. Intended for populating select inputs in the UI.

Response

success
boolean
required
true when the query completes without error.
data
object[]
required
Array of all profile objects.

Error response

When an unexpected server error occurs:
500
{
  "statusCode": 500,
  "message": "Error al cargar lista de perfiles"
}

Examples

curl --request GET \
  --url 'https://your-domain.com/api/perfil/list' \
  --cookie 'auth_token=<your-jwt>'

Success response

200
{
  "success": true,
  "data": [
    { "id": 1, "strNombrePerfil": "Operador" },
    { "id": 2, "strNombrePerfil": "Supervisor" },
    { "id": 3, "strNombrePerfil": "Administrador" }
  ]
}

Build docs developers (and LLMs) love